@notionhq/custom-blocks 0.1.17 → 0.1.19
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/dist/bridge/SandboxBridge.d.ts +2 -1
- package/dist/bridge/SandboxBridge.d.ts.map +1 -1
- package/dist/bridge/SandboxBridge.js +41 -5
- package/dist/bridge/appearance.d.ts +15 -0
- package/dist/bridge/appearance.d.ts.map +1 -0
- package/dist/bridge/appearance.js +14 -0
- package/dist/bridge/sandboxClient.d.ts +1 -0
- package/dist/bridge/sandboxClient.d.ts.map +1 -1
- package/dist/bridge/sandboxClient.js +26 -17
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +1 -0
- package/dist/protocol/dataSources/dataSource.d.ts +12 -12
- package/dist/protocol/dataSources/dataSourcePage.d.ts +1 -1
- package/dist/protocol/ids.d.ts +10 -26
- package/dist/protocol/ids.d.ts.map +1 -1
- package/dist/protocol/ids.js +25 -5
- package/dist/protocol/messages/createPage.d.ts +8 -8
- package/dist/protocol/messages/createPageResult.d.ts +5 -5
- package/dist/protocol/messages/currentUserChanged.d.ts +1 -1
- package/dist/protocol/messages/dataSourcesChanged.d.ts +3 -3
- package/dist/protocol/messages/getPage.d.ts +6 -6
- package/dist/protocol/messages/getUser.d.ts +2 -2
- package/dist/protocol/messages/getUser.js +2 -2
- package/dist/protocol/messages/hostToSandbox.d.ts +45 -45
- package/dist/protocol/messages/init.d.ts +14 -14
- package/dist/protocol/messages/listUsers.d.ts +1 -1
- package/dist/protocol/messages/pageChanged.d.ts +5 -5
- package/dist/protocol/messages/parentChanged.d.ts +4 -4
- package/dist/protocol/messages/queryDataSource.d.ts +1 -1
- package/dist/protocol/messages/queryDataSourceResult.d.ts +1 -1
- package/dist/protocol/messages/sandboxToHost.d.ts +8 -8
- package/dist/protocol/messages/updatePage.d.ts +1 -1
- package/dist/protocol/messages/updatePageResult.d.ts +5 -5
- package/dist/protocol/pages/page.d.ts +10 -10
- package/dist/protocol/parent.d.ts +4 -4
- package/dist/protocol/users/user.d.ts +4 -7
- package/dist/protocol/users/user.d.ts.map +1 -1
- package/dist/protocol/users/user.js +2 -1
- package/dist/react/standalonePreview.d.ts.map +1 -1
- package/dist/react/standalonePreview.js +3 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/src/bridge/SandboxBridge.ts +49 -6
- package/src/bridge/appearance.ts +14 -0
- package/src/bridge/sandboxClient.ts +28 -17
- package/src/init.ts +1 -0
- package/src/react/standalonePreview.ts +3 -1
|
@@ -28,10 +28,11 @@ export declare class SandboxBridge {
|
|
|
28
28
|
private initializationId;
|
|
29
29
|
private latestDataSourceBindings;
|
|
30
30
|
private isMockState;
|
|
31
|
+
private isListening;
|
|
31
32
|
private resolveInit;
|
|
32
33
|
private rejectInit;
|
|
33
34
|
private readonly initMessage;
|
|
34
|
-
|
|
35
|
+
startListening(): void;
|
|
35
36
|
private static MAX_LOG_ENTRIES;
|
|
36
37
|
private logMessage;
|
|
37
38
|
getMessageLog(): readonly MessageLogEntry[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SandboxBridge.d.ts","sourceRoot":"","sources":["../../../../home/runner/work/custom-blocks/custom-blocks/sdk/src/bridge/SandboxBridge.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SandboxBridge.d.ts","sourceRoot":"","sources":["../../../../home/runner/work/custom-blocks/custom-blocks/sdk/src/bridge/SandboxBridge.ts"],"names":[],"mappings":"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"}
|
|
@@ -6,6 +6,7 @@ import { CUSTOM_BLOCK_BRIDGE_PROTOCOL_VERSION } from "../protocol/protocolVersio
|
|
|
6
6
|
import * as v from "valibot";
|
|
7
7
|
import { unreachable } from "../utils.js";
|
|
8
8
|
import { CUSTOM_BLOCKS_SDK_VERSION } from "../version.js";
|
|
9
|
+
import { NOTION_DARK_BACKGROUND_BASE, NOTION_LIGHT_BACKGROUND_BASE, } from "./appearance.js";
|
|
9
10
|
import { resolveDataSources } from "./dataSources/resolve.js";
|
|
10
11
|
import { resolvePropertyWriteMapForDataSource } from "./dataSources/resolveProperty.js";
|
|
11
12
|
import { createEmptyDataSourceQueryState, } from "./hostState.js";
|
|
@@ -30,6 +31,7 @@ export class SandboxBridge {
|
|
|
30
31
|
this.hasReceivedInit = false;
|
|
31
32
|
this.latestDataSourceBindings = {};
|
|
32
33
|
this.isMockState = false;
|
|
34
|
+
this.isListening = false;
|
|
33
35
|
this.initMessage = new Promise((resolve, reject) => {
|
|
34
36
|
this.resolveInit = resolve;
|
|
35
37
|
this.rejectInit = reject;
|
|
@@ -103,6 +105,10 @@ export class SandboxBridge {
|
|
|
103
105
|
...hostState,
|
|
104
106
|
theme: message.theme,
|
|
105
107
|
};
|
|
108
|
+
syncDocumentAppearance({
|
|
109
|
+
theme: message.theme,
|
|
110
|
+
contrastMode: hostState.contrastMode,
|
|
111
|
+
});
|
|
106
112
|
this.notify();
|
|
107
113
|
return;
|
|
108
114
|
}
|
|
@@ -111,6 +117,10 @@ export class SandboxBridge {
|
|
|
111
117
|
...hostState,
|
|
112
118
|
contrastMode: message.contrastMode,
|
|
113
119
|
};
|
|
120
|
+
syncDocumentAppearance({
|
|
121
|
+
theme: hostState.theme,
|
|
122
|
+
contrastMode: message.contrastMode,
|
|
123
|
+
});
|
|
114
124
|
this.notify();
|
|
115
125
|
return;
|
|
116
126
|
}
|
|
@@ -252,12 +262,13 @@ export class SandboxBridge {
|
|
|
252
262
|
}
|
|
253
263
|
}
|
|
254
264
|
};
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
window.addEventListener("message", this.handleMessage);
|
|
265
|
+
}
|
|
266
|
+
startListening() {
|
|
267
|
+
if (this.isListening || typeof window === "undefined") {
|
|
268
|
+
return;
|
|
260
269
|
}
|
|
270
|
+
this.isListening = true;
|
|
271
|
+
window.addEventListener("message", this.handleMessage);
|
|
261
272
|
}
|
|
262
273
|
logMessage(direction, data) {
|
|
263
274
|
if (this.messageLog.length >= SandboxBridge.MAX_LOG_ENTRIES) {
|
|
@@ -408,6 +419,10 @@ export class SandboxBridge {
|
|
|
408
419
|
dataSources,
|
|
409
420
|
dataSourceState: {},
|
|
410
421
|
};
|
|
422
|
+
syncDocumentAppearance({
|
|
423
|
+
theme: message.theme,
|
|
424
|
+
contrastMode: message.contrastMode,
|
|
425
|
+
});
|
|
411
426
|
this.notify();
|
|
412
427
|
if (postResult) {
|
|
413
428
|
const result = {
|
|
@@ -697,6 +712,27 @@ export class SandboxBridge {
|
|
|
697
712
|
}
|
|
698
713
|
}
|
|
699
714
|
SandboxBridge.MAX_LOG_ENTRIES = 100;
|
|
715
|
+
/**
|
|
716
|
+
* Makes the document canvas match the host appearance before acknowledging init.
|
|
717
|
+
*
|
|
718
|
+
* The host reveals the iframe as soon as it receives `initResult.success`. Applying these
|
|
719
|
+
* attributes synchronously prevents the browser's default white canvas from flashing while React
|
|
720
|
+
* mounts a token scope.
|
|
721
|
+
*/
|
|
722
|
+
function syncDocumentAppearance(args) {
|
|
723
|
+
if (typeof document === "undefined") {
|
|
724
|
+
return;
|
|
725
|
+
}
|
|
726
|
+
const { theme, contrastMode } = args;
|
|
727
|
+
const root = document.documentElement;
|
|
728
|
+
root.dataset.displayMode = theme;
|
|
729
|
+
root.dataset.contrastMode = contrastMode;
|
|
730
|
+
root.style.colorScheme = theme;
|
|
731
|
+
root.style.backgroundColor =
|
|
732
|
+
theme === "dark"
|
|
733
|
+
? NOTION_DARK_BACKGROUND_BASE
|
|
734
|
+
: NOTION_LIGHT_BACKGROUND_BASE;
|
|
735
|
+
}
|
|
700
736
|
/**
|
|
701
737
|
* `postMessage` cloning creates new objects even for bindings that did not change.
|
|
702
738
|
* Preserve their resolved object identity so React effects only run for changed bindings.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Background color values used before the NDS token scope mounts.
|
|
3
|
+
*
|
|
4
|
+
* The light value matches NDS's semantic `--bg-base` token in light mode
|
|
5
|
+
* (`--gray-0`, white). The dark value is the existing SDK fallback canvas
|
|
6
|
+
* color; it is not an exact current generated NDS value. Current NDS maps
|
|
7
|
+
* dark `--bg-base` to `--gray-145` (approximately `#1b1b1b`), while the
|
|
8
|
+
* legacy notion-next gray surface is `rgba(32, 32, 32, 1)`.
|
|
9
|
+
*
|
|
10
|
+
* Keep the resolved values here because the document must be styled before the block's NDS
|
|
11
|
+
* stylesheet and token scope are guaranteed to be available.
|
|
12
|
+
*/
|
|
13
|
+
export declare const NOTION_DARK_BACKGROUND_BASE = "#191918";
|
|
14
|
+
export declare const NOTION_LIGHT_BACKGROUND_BASE = "#ffffff";
|
|
15
|
+
//# sourceMappingURL=appearance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appearance.d.ts","sourceRoot":"","sources":["../../../../home/runner/work/custom-blocks/custom-blocks/sdk/src/bridge/appearance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,2BAA2B,YAAY,CAAA;AACpD,eAAO,MAAM,4BAA4B,YAAY,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Background color values used before the NDS token scope mounts.
|
|
3
|
+
*
|
|
4
|
+
* The light value matches NDS's semantic `--bg-base` token in light mode
|
|
5
|
+
* (`--gray-0`, white). The dark value is the existing SDK fallback canvas
|
|
6
|
+
* color; it is not an exact current generated NDS value. Current NDS maps
|
|
7
|
+
* dark `--bg-base` to `--gray-145` (approximately `#1b1b1b`), while the
|
|
8
|
+
* legacy notion-next gray surface is `rgba(32, 32, 32, 1)`.
|
|
9
|
+
*
|
|
10
|
+
* Keep the resolved values here because the document must be styled before the block's NDS
|
|
11
|
+
* stylesheet and token scope are guaranteed to be available.
|
|
12
|
+
*/
|
|
13
|
+
export const NOTION_DARK_BACKGROUND_BASE = "#191918";
|
|
14
|
+
export const NOTION_LIGHT_BACKGROUND_BASE = "#ffffff";
|
|
@@ -5,6 +5,7 @@ import type { ManifestLoadResult } from "./loadManifest.js";
|
|
|
5
5
|
import { type MessageLogEntry } from "./SandboxBridge.js";
|
|
6
6
|
export type { MessageLogEntry };
|
|
7
7
|
export declare const customBlockHost: {
|
|
8
|
+
start: () => void;
|
|
8
9
|
sendConnect: (manifestResult: ManifestLoadResult) => void;
|
|
9
10
|
awaitInit: (signal?: AbortSignal) => Promise<void>;
|
|
10
11
|
subscribe: (listener: () => void) => () => boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sandboxClient.d.ts","sourceRoot":"","sources":["../../../../home/runner/work/custom-blocks/custom-blocks/sdk/src/bridge/sandboxClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mDAAmD,CAAA;AACpF,OAAO,KAAK,EACX,cAAc,EACd,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,aAAa,EACb,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,MAAM,aAAa,CAAA;AACpB,OAAO,EACN,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EAExB,MAAM,gBAAgB,CAAA;AACvB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,EAAE,KAAK,eAAe,EAAiB,MAAM,oBAAoB,CAAA;AAExE,YAAY,EAAE,eAAe,EAAE,CAAA;
|
|
1
|
+
{"version":3,"file":"sandboxClient.d.ts","sourceRoot":"","sources":["../../../../home/runner/work/custom-blocks/custom-blocks/sdk/src/bridge/sandboxClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mDAAmD,CAAA;AACpF,OAAO,KAAK,EACX,cAAc,EACd,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,aAAa,EACb,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,MAAM,aAAa,CAAA;AACpB,OAAO,EACN,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EAExB,MAAM,gBAAgB,CAAA;AACvB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,EAAE,KAAK,eAAe,EAAiB,MAAM,oBAAoB,CAAA;AAExE,YAAY,EAAE,eAAe,EAAE,CAAA;AAW/B,eAAO,MAAM,eAAe;;kCAKG,kBAAkB;yBAI3B,WAAW,KAAG,OAAO,CAAC,IAAI,CAAC;0BAI1B,MAAM,IAAI;oBAIlB,oBAAoB;IAIlC;;;OAGG;4BACqB,WAAW;yBAId,MAAM;CAG3B,CAAA;AAED,eAAO,MAAM,sBAAsB;iBACrB,MAAM,YAAY,oBAAoB;yBAKvC,oBAAoB,OAC1B,MAAM,KACT,mBAAmB;CAKtB,CAAA;AAED,eAAO,MAAM,UAAU;uBACL,SAAS,eAAe,EAAE;0BAIrB,MAAM,IAAI;CAGhC,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,KAAK;IACjB;;OAEG;oBACa,cAAc,KAAG,OAAO,CAAC,gBAAgB,CAAC;IAI1D;;OAEG;kBACW,YAAY,KAAG,OAAO,CAAC,aAAa,CAAC;IAInD;;OAEG;oBACa,cAAc,KAAG,OAAO,CAAC,gBAAgB,CAAC;IAI1D;;OAEG;qBACc,YAAY,KAAG,OAAO,CAAC,gBAAgB,CAAC;CAGzD,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,KAAK;IACjB;;OAEG;mBACY,aAAa,KAAG,OAAO,CAAC,eAAe,CAAC;IAIvD;;OAEG;kBACW,YAAY,KAAG,OAAO,CAAC,aAAa,CAAC;CAGnD,CAAA"}
|
|
@@ -1,44 +1,53 @@
|
|
|
1
1
|
import { getDataSourceQueryView as getDataSourceQueryViewWithBridge, } from "./hostState.js";
|
|
2
2
|
import { SandboxBridge } from "./SandboxBridge.js";
|
|
3
|
-
|
|
3
|
+
let bridge;
|
|
4
|
+
function getBridge() {
|
|
5
|
+
if (!bridge) {
|
|
6
|
+
bridge = new SandboxBridge();
|
|
7
|
+
}
|
|
8
|
+
return bridge;
|
|
9
|
+
}
|
|
4
10
|
export const customBlockHost = {
|
|
11
|
+
start: () => {
|
|
12
|
+
getBridge().startListening();
|
|
13
|
+
},
|
|
5
14
|
sendConnect: (manifestResult) => {
|
|
6
|
-
|
|
15
|
+
getBridge().sendConnect(manifestResult);
|
|
7
16
|
},
|
|
8
17
|
awaitInit: (signal) => {
|
|
9
|
-
return
|
|
18
|
+
return getBridge().awaitInit(signal);
|
|
10
19
|
},
|
|
11
20
|
subscribe: (listener) => {
|
|
12
|
-
return
|
|
21
|
+
return getBridge().subscribe(listener);
|
|
13
22
|
},
|
|
14
23
|
getState: () => {
|
|
15
|
-
return
|
|
24
|
+
return getBridge().getHostState();
|
|
16
25
|
},
|
|
17
26
|
/**
|
|
18
27
|
* Apply an `init` payload directly, bypassing the postMessage handshake for
|
|
19
28
|
* standalone preview state.
|
|
20
29
|
*/
|
|
21
30
|
setMockState: (message) => {
|
|
22
|
-
|
|
31
|
+
getBridge().setMockState(message);
|
|
23
32
|
},
|
|
24
33
|
postResize: (height) => {
|
|
25
|
-
|
|
34
|
+
getBridge().postResize(height);
|
|
26
35
|
},
|
|
27
36
|
};
|
|
28
37
|
export const customBlockDataSources = {
|
|
29
38
|
query: (key, options) => {
|
|
30
|
-
|
|
39
|
+
getBridge().queryDataSource(key, options);
|
|
31
40
|
},
|
|
32
41
|
getView: (hostState, key) => {
|
|
33
|
-
return getDataSourceQueryViewWithBridge(hostState, key, args =>
|
|
42
|
+
return getDataSourceQueryViewWithBridge(hostState, key, args => getBridge().updateDataSourcePage(args));
|
|
34
43
|
},
|
|
35
44
|
};
|
|
36
45
|
export const messageLog = {
|
|
37
46
|
getSnapshot: () => {
|
|
38
|
-
return
|
|
47
|
+
return getBridge().getMessageLog();
|
|
39
48
|
},
|
|
40
49
|
subscribe: (listener) => {
|
|
41
|
-
return
|
|
50
|
+
return getBridge().subscribeToMessageLog(listener);
|
|
42
51
|
},
|
|
43
52
|
};
|
|
44
53
|
/**
|
|
@@ -49,25 +58,25 @@ export const pages = {
|
|
|
49
58
|
* Creates a new Notion page.
|
|
50
59
|
*/
|
|
51
60
|
create: (input) => {
|
|
52
|
-
return
|
|
61
|
+
return getBridge().createPage(input);
|
|
53
62
|
},
|
|
54
63
|
/**
|
|
55
64
|
* Fetches a page by id.
|
|
56
65
|
*/
|
|
57
66
|
get: (pageId) => {
|
|
58
|
-
return
|
|
67
|
+
return getBridge().getPage(pageId);
|
|
59
68
|
},
|
|
60
69
|
/**
|
|
61
70
|
* Updates an existing page.
|
|
62
71
|
*/
|
|
63
72
|
update: (input) => {
|
|
64
|
-
return
|
|
73
|
+
return getBridge().updatePage(input);
|
|
65
74
|
},
|
|
66
75
|
/**
|
|
67
76
|
* Soft-delete a page by archiving it.
|
|
68
77
|
*/
|
|
69
78
|
delete: (pageId) => {
|
|
70
|
-
return
|
|
79
|
+
return getBridge().updatePage({ pageId, archived: true });
|
|
71
80
|
},
|
|
72
81
|
};
|
|
73
82
|
/**
|
|
@@ -78,12 +87,12 @@ export const users = {
|
|
|
78
87
|
* Lists users visible in the current custom block workspace.
|
|
79
88
|
*/
|
|
80
89
|
list: (input) => {
|
|
81
|
-
return
|
|
90
|
+
return getBridge().listUsers(input);
|
|
82
91
|
},
|
|
83
92
|
/**
|
|
84
93
|
* Fetches a user by id.
|
|
85
94
|
*/
|
|
86
95
|
get: (userId) => {
|
|
87
|
-
return
|
|
96
|
+
return getBridge().getUser(userId);
|
|
88
97
|
},
|
|
89
98
|
};
|
package/dist/init.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../home/runner/work/custom-blocks/custom-blocks/sdk/src/init.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAA;AACtF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4DAA4D,CAAA;AAClG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAA;AAC5E,OAAO,EAAE,8BAA8B,EAAE,MAAM,mDAAmD,CAAA;AAClG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAA;AACrF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAA;AAC9E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAA;AAC5E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gDAAgD,CAAA;AAKhF;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACpC,KAAK,EAAE,WAAW,CAAA;IAClB,YAAY,EAAE,kBAAkB,CAAA;IAChC,OAAO,EAAE,aAAa,CAAA;IACtB,MAAM,EAAE,YAAY,CAAA;IACpB,IAAI,EAAE,eAAe,CAAA;IACrB,WAAW,EAAE,UAAU,CAAA;IACvB,WAAW,EAAE,gBAAgB,EAAE,CAAA;CAC/B,CAAA;AAED;;;;;GAKG;AACH,qBAAa,gBAAiB,SAAQ,8BAA8B;gBACvD,OAAO,GAAE,MAA8B;IAS3C,IAAI,EAAE,eAAe,CAAA;CAC7B;AAED;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACpC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AASD;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC9B,IAAI,GAAE,sBAA2B,GAC/B,OAAO,CAAC,sBAAsB,CAAC,
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../home/runner/work/custom-blocks/custom-blocks/sdk/src/init.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAA;AACtF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4DAA4D,CAAA;AAClG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAA;AAC5E,OAAO,EAAE,8BAA8B,EAAE,MAAM,mDAAmD,CAAA;AAClG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAA;AACrF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAA;AAC9E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAA;AAC5E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gDAAgD,CAAA;AAKhF;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACpC,KAAK,EAAE,WAAW,CAAA;IAClB,YAAY,EAAE,kBAAkB,CAAA;IAChC,OAAO,EAAE,aAAa,CAAA;IACtB,MAAM,EAAE,YAAY,CAAA;IACpB,IAAI,EAAE,eAAe,CAAA;IACrB,WAAW,EAAE,UAAU,CAAA;IACvB,WAAW,EAAE,gBAAgB,EAAE,CAAA;CAC/B,CAAA;AAED;;;;;GAKG;AACH,qBAAa,gBAAiB,SAAQ,8BAA8B;gBACvD,OAAO,GAAE,MAA8B;IAS3C,IAAI,EAAE,eAAe,CAAA;CAC7B;AAED;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACpC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AASD;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC9B,IAAI,GAAE,sBAA2B,GAC/B,OAAO,CAAC,sBAAsB,CAAC,CAMjC"}
|
package/dist/init.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
2
|
declare const collectionPointerValidator: v.ObjectSchema<{
|
|
3
|
-
readonly id: v.
|
|
3
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionDataSourceId">]>;
|
|
4
4
|
readonly table: v.StringSchema<undefined>;
|
|
5
|
-
readonly spaceId: v.OptionalSchema<v.
|
|
5
|
+
readonly spaceId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionSpaceId">]>, undefined>;
|
|
6
6
|
}, undefined>;
|
|
7
7
|
export type NotionCollectionPointer = v.InferOutput<typeof collectionPointerValidator>;
|
|
8
8
|
export declare const notionCollectionSchemaValidator: v.ObjectSchema<{
|
|
9
|
-
readonly id: v.OptionalSchema<v.
|
|
9
|
+
readonly id: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionDataSourceId">]>, undefined>;
|
|
10
10
|
readonly propertiesById: v.RecordSchema<v.StringSchema<undefined>, v.VariantSchema<"type", [v.ObjectSchema<{
|
|
11
11
|
readonly type: v.LiteralSchema<"title", undefined>;
|
|
12
12
|
readonly name: v.StringSchema<undefined>;
|
|
@@ -150,12 +150,12 @@ export type NotionCollectionSchema = v.InferOutput<typeof notionCollectionSchema
|
|
|
150
150
|
export declare const notionDataSourceSchema: v.ObjectSchema<{
|
|
151
151
|
readonly key: v.StringSchema<undefined>;
|
|
152
152
|
readonly collectionPointer: v.OptionalSchema<v.ObjectSchema<{
|
|
153
|
-
readonly id: v.
|
|
153
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionDataSourceId">]>;
|
|
154
154
|
readonly table: v.StringSchema<undefined>;
|
|
155
|
-
readonly spaceId: v.OptionalSchema<v.
|
|
155
|
+
readonly spaceId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionSpaceId">]>, undefined>;
|
|
156
156
|
}, undefined>, undefined>;
|
|
157
157
|
readonly collectionSchema: v.OptionalSchema<v.ObjectSchema<{
|
|
158
|
-
readonly id: v.OptionalSchema<v.
|
|
158
|
+
readonly id: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionDataSourceId">]>, undefined>;
|
|
159
159
|
readonly propertiesById: v.RecordSchema<v.StringSchema<undefined>, v.VariantSchema<"type", [v.ObjectSchema<{
|
|
160
160
|
readonly type: v.LiteralSchema<"title", undefined>;
|
|
161
161
|
readonly name: v.StringSchema<undefined>;
|
|
@@ -438,12 +438,12 @@ export declare const notionDataSourceSchema: v.ObjectSchema<{
|
|
|
438
438
|
export type NotionDataSource = v.InferOutput<typeof notionDataSourceSchema>;
|
|
439
439
|
export declare const notionDataSourceBindingSchema: v.ObjectSchema<{
|
|
440
440
|
readonly collectionPointer: v.OptionalSchema<v.ObjectSchema<{
|
|
441
|
-
readonly id: v.
|
|
441
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionDataSourceId">]>;
|
|
442
442
|
readonly table: v.StringSchema<undefined>;
|
|
443
|
-
readonly spaceId: v.OptionalSchema<v.
|
|
443
|
+
readonly spaceId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionSpaceId">]>, undefined>;
|
|
444
444
|
}, undefined>, undefined>;
|
|
445
445
|
readonly collectionSchema: v.OptionalSchema<v.ObjectSchema<{
|
|
446
|
-
readonly id: v.OptionalSchema<v.
|
|
446
|
+
readonly id: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionDataSourceId">]>, undefined>;
|
|
447
447
|
readonly propertiesById: v.RecordSchema<v.StringSchema<undefined>, v.VariantSchema<"type", [v.ObjectSchema<{
|
|
448
448
|
readonly type: v.LiteralSchema<"title", undefined>;
|
|
449
449
|
readonly name: v.StringSchema<undefined>;
|
|
@@ -584,12 +584,12 @@ export declare const notionDataSourceBindingSchema: v.ObjectSchema<{
|
|
|
584
584
|
export type NotionDataSourceBinding = v.InferOutput<typeof notionDataSourceBindingSchema>;
|
|
585
585
|
export declare const notionDataSourceBindingsSchema: v.RecordSchema<v.StringSchema<undefined>, v.ObjectSchema<{
|
|
586
586
|
readonly collectionPointer: v.OptionalSchema<v.ObjectSchema<{
|
|
587
|
-
readonly id: v.
|
|
587
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionDataSourceId">]>;
|
|
588
588
|
readonly table: v.StringSchema<undefined>;
|
|
589
|
-
readonly spaceId: v.OptionalSchema<v.
|
|
589
|
+
readonly spaceId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionSpaceId">]>, undefined>;
|
|
590
590
|
}, undefined>, undefined>;
|
|
591
591
|
readonly collectionSchema: v.OptionalSchema<v.ObjectSchema<{
|
|
592
|
-
readonly id: v.OptionalSchema<v.
|
|
592
|
+
readonly id: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionDataSourceId">]>, undefined>;
|
|
593
593
|
readonly propertiesById: v.RecordSchema<v.StringSchema<undefined>, v.VariantSchema<"type", [v.ObjectSchema<{
|
|
594
594
|
readonly type: v.LiteralSchema<"title", undefined>;
|
|
595
595
|
readonly name: v.StringSchema<undefined>;
|
|
@@ -5,7 +5,7 @@ import * as v from "valibot";
|
|
|
5
5
|
* `created_by`, `last_edited_by`) are normally present, possibly with `undefined` values.
|
|
6
6
|
*/
|
|
7
7
|
export declare const notionDataSourcePageBridgeSchema: v.ObjectSchema<{
|
|
8
|
-
readonly id: v.
|
|
8
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionPageId">]>;
|
|
9
9
|
readonly propertiesById: v.RecordSchema<v.StringSchema<undefined>, v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>, v.BooleanSchema<undefined>, v.VariantSchema<"type", [v.ObjectSchema<{
|
|
10
10
|
readonly type: v.LiteralSchema<"date", undefined>;
|
|
11
11
|
readonly start_date: v.StringSchema<undefined>;
|
package/dist/protocol/ids.d.ts
CHANGED
|
@@ -1,48 +1,32 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
|
-
declare const notionDataSourceIdBrand: unique symbol;
|
|
3
|
-
declare const notionBlockIdBrand: unique symbol;
|
|
4
|
-
declare const notionPageIdBrand: unique symbol;
|
|
5
|
-
declare const notionAgentIdBrand: unique symbol;
|
|
6
|
-
declare const notionSpaceIdBrand: unique symbol;
|
|
7
2
|
/**
|
|
8
3
|
* Branded Notion block ID. Host payloads and SDK APIs use plain strings at runtime,
|
|
9
4
|
* but the brand keeps block IDs from being accidentally mixed with other IDs in TypeScript.
|
|
10
5
|
*/
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
};
|
|
14
|
-
export declare const notionBlockIdSchema: v.CustomSchema<NotionBlockId, v.ErrorMessage<v.CustomIssue> | undefined>;
|
|
6
|
+
export declare const notionBlockIdSchema: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionBlockId">]>;
|
|
7
|
+
export type NotionBlockId = v.InferOutput<typeof notionBlockIdSchema>;
|
|
15
8
|
/**
|
|
16
9
|
* Branded Notion data source ID. Host payloads and SDK APIs use plain strings at runtime,
|
|
17
10
|
* but the brand keeps data source IDs from being accidentally mixed with other IDs in TypeScript.
|
|
18
11
|
*/
|
|
19
|
-
export
|
|
20
|
-
|
|
21
|
-
};
|
|
22
|
-
export declare const notionDataSourceIdSchema: v.CustomSchema<NotionDataSourceId, v.ErrorMessage<v.CustomIssue> | undefined>;
|
|
12
|
+
export declare const notionDataSourceIdSchema: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionDataSourceId">]>;
|
|
13
|
+
export type NotionDataSourceId = v.InferOutput<typeof notionDataSourceIdSchema>;
|
|
23
14
|
/**
|
|
24
15
|
* Branded Notion page ID. Host payloads and SDK APIs use plain strings at runtime,
|
|
25
16
|
* but the brand keeps page IDs from being accidentally mixed with other IDs in TypeScript.
|
|
26
17
|
*/
|
|
27
|
-
export
|
|
28
|
-
|
|
29
|
-
};
|
|
30
|
-
export declare const notionPageIdSchema: v.CustomSchema<NotionPageId, v.ErrorMessage<v.CustomIssue> | undefined>;
|
|
18
|
+
export declare const notionPageIdSchema: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionPageId">]>;
|
|
19
|
+
export type NotionPageId = v.InferOutput<typeof notionPageIdSchema>;
|
|
31
20
|
/**
|
|
32
21
|
* Branded Notion agent ID. Agent parents identify the workflow that owns an
|
|
33
22
|
* instruction page or one of its blocks.
|
|
34
23
|
*/
|
|
35
|
-
export
|
|
36
|
-
|
|
37
|
-
};
|
|
38
|
-
export declare const notionAgentIdSchema: v.CustomSchema<NotionAgentId, v.ErrorMessage<v.CustomIssue> | undefined>;
|
|
24
|
+
export declare const notionAgentIdSchema: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionAgentId">]>;
|
|
25
|
+
export type NotionAgentId = v.InferOutput<typeof notionAgentIdSchema>;
|
|
39
26
|
/**
|
|
40
27
|
* Branded Notion workspace/space ID. Host payloads and SDK APIs use plain strings at runtime,
|
|
41
28
|
* but the brand keeps space IDs from being accidentally mixed with other IDs in TypeScript.
|
|
42
29
|
*/
|
|
43
|
-
export
|
|
44
|
-
|
|
45
|
-
};
|
|
46
|
-
export declare const notionSpaceIdSchema: v.CustomSchema<NotionSpaceId, v.ErrorMessage<v.CustomIssue> | undefined>;
|
|
47
|
-
export {};
|
|
30
|
+
export declare const notionSpaceIdSchema: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionSpaceId">]>;
|
|
31
|
+
export type NotionSpaceId = v.InferOutput<typeof notionSpaceIdSchema>;
|
|
48
32
|
//# sourceMappingURL=ids.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ids.d.ts","sourceRoot":"","sources":["../../../../home/runner/work/custom-blocks/custom-blocks/protocol/src/ids.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B
|
|
1
|
+
{"version":3,"file":"ids.d.ts","sourceRoot":"","sources":["../../../../home/runner/work/custom-blocks/custom-blocks/protocol/src/ids.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B;;;GAGG;AACH,eAAO,MAAM,mBAAmB,gGAA+C,CAAA;AAC/E,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAErE;;;GAGG;AACH,eAAO,MAAM,wBAAwB,qGAGpC,CAAA;AACD,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAE/E;;;GAGG;AACH,eAAO,MAAM,kBAAkB,+FAA8C,CAAA;AAC7E,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAEnE;;;GAGG;AACH,eAAO,MAAM,mBAAmB,gGAA+C,CAAA;AAC/E,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAErE;;;GAGG;AACH,eAAO,MAAM,mBAAmB,gGAA+C,CAAA;AAC/E,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,mBAAmB,CAAC,CAAA"}
|
package/dist/protocol/ids.js
CHANGED
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export const
|
|
2
|
+
/**
|
|
3
|
+
* Branded Notion block ID. Host payloads and SDK APIs use plain strings at runtime,
|
|
4
|
+
* but the brand keeps block IDs from being accidentally mixed with other IDs in TypeScript.
|
|
5
|
+
*/
|
|
6
|
+
export const notionBlockIdSchema = v.pipe(v.string(), v.brand("NotionBlockId"));
|
|
7
|
+
/**
|
|
8
|
+
* Branded Notion data source ID. Host payloads and SDK APIs use plain strings at runtime,
|
|
9
|
+
* but the brand keeps data source IDs from being accidentally mixed with other IDs in TypeScript.
|
|
10
|
+
*/
|
|
11
|
+
export const notionDataSourceIdSchema = v.pipe(v.string(), v.brand("NotionDataSourceId"));
|
|
12
|
+
/**
|
|
13
|
+
* Branded Notion page ID. Host payloads and SDK APIs use plain strings at runtime,
|
|
14
|
+
* but the brand keeps page IDs from being accidentally mixed with other IDs in TypeScript.
|
|
15
|
+
*/
|
|
16
|
+
export const notionPageIdSchema = v.pipe(v.string(), v.brand("NotionPageId"));
|
|
17
|
+
/**
|
|
18
|
+
* Branded Notion agent ID. Agent parents identify the workflow that owns an
|
|
19
|
+
* instruction page or one of its blocks.
|
|
20
|
+
*/
|
|
21
|
+
export const notionAgentIdSchema = v.pipe(v.string(), v.brand("NotionAgentId"));
|
|
22
|
+
/**
|
|
23
|
+
* Branded Notion workspace/space ID. Host payloads and SDK APIs use plain strings at runtime,
|
|
24
|
+
* but the brand keeps space IDs from being accidentally mixed with other IDs in TypeScript.
|
|
25
|
+
*/
|
|
26
|
+
export const notionSpaceIdSchema = v.pipe(v.string(), v.brand("NotionSpaceId"));
|
|
@@ -13,10 +13,10 @@ export declare const notionCreatePagePositionSchema: v.VariantSchema<"type", [v.
|
|
|
13
13
|
readonly type: v.LiteralSchema<"end", undefined>;
|
|
14
14
|
}, undefined>, v.ObjectSchema<{
|
|
15
15
|
readonly type: v.LiteralSchema<"before", undefined>;
|
|
16
|
-
readonly blockId: v.
|
|
16
|
+
readonly blockId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionBlockId">]>;
|
|
17
17
|
}, undefined>, v.ObjectSchema<{
|
|
18
18
|
readonly type: v.LiteralSchema<"after", undefined>;
|
|
19
|
-
readonly blockId: v.
|
|
19
|
+
readonly blockId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionBlockId">]>;
|
|
20
20
|
}, undefined>], undefined>;
|
|
21
21
|
export type NotionCreatePagePosition = v.InferOutput<typeof notionCreatePagePositionSchema>;
|
|
22
22
|
/**
|
|
@@ -30,10 +30,10 @@ export type NotionCreatePagePosition = v.InferOutput<typeof notionCreatePagePosi
|
|
|
30
30
|
*/
|
|
31
31
|
export declare const createPageParentSchema: v.VariantSchema<"type", [v.ObjectSchema<{
|
|
32
32
|
readonly type: v.LiteralSchema<"page_id", undefined>;
|
|
33
|
-
readonly page_id: v.
|
|
33
|
+
readonly page_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionPageId">]>;
|
|
34
34
|
}, undefined>, v.ObjectSchema<{
|
|
35
35
|
readonly type: v.LiteralSchema<"data_source_id", undefined>;
|
|
36
|
-
readonly data_source_id: v.
|
|
36
|
+
readonly data_source_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionDataSourceId">]>;
|
|
37
37
|
}, undefined>], undefined>;
|
|
38
38
|
export type CreatePageMessageParent = v.InferOutput<typeof createPageParentSchema>;
|
|
39
39
|
/**
|
|
@@ -45,10 +45,10 @@ export declare const createPageMessageSchema: v.ObjectSchema<{
|
|
|
45
45
|
readonly requestId: v.StringSchema<undefined>;
|
|
46
46
|
readonly parent: v.VariantSchema<"type", [v.ObjectSchema<{
|
|
47
47
|
readonly type: v.LiteralSchema<"page_id", undefined>;
|
|
48
|
-
readonly page_id: v.
|
|
48
|
+
readonly page_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionPageId">]>;
|
|
49
49
|
}, undefined>, v.ObjectSchema<{
|
|
50
50
|
readonly type: v.LiteralSchema<"data_source_id", undefined>;
|
|
51
|
-
readonly data_source_id: v.
|
|
51
|
+
readonly data_source_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionDataSourceId">]>;
|
|
52
52
|
}, undefined>], undefined>;
|
|
53
53
|
readonly properties: v.RecordSchema<v.StringSchema<undefined>, v.VariantSchema<"type", [v.ObjectSchema<{
|
|
54
54
|
readonly type: v.LiteralSchema<"title", undefined>;
|
|
@@ -181,10 +181,10 @@ export declare const createPageMessageSchema: v.ObjectSchema<{
|
|
|
181
181
|
readonly type: v.LiteralSchema<"end", undefined>;
|
|
182
182
|
}, undefined>, v.ObjectSchema<{
|
|
183
183
|
readonly type: v.LiteralSchema<"before", undefined>;
|
|
184
|
-
readonly blockId: v.
|
|
184
|
+
readonly blockId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionBlockId">]>;
|
|
185
185
|
}, undefined>, v.ObjectSchema<{
|
|
186
186
|
readonly type: v.LiteralSchema<"after", undefined>;
|
|
187
|
-
readonly blockId: v.
|
|
187
|
+
readonly blockId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionBlockId">]>;
|
|
188
188
|
}, undefined>], undefined>, undefined>;
|
|
189
189
|
}, undefined>;
|
|
190
190
|
export type CreatePageMessage = v.InferOutput<typeof createPageMessageSchema>;
|
|
@@ -18,22 +18,22 @@ export declare const createPageResultMessageSchema: v.VariantSchema<"status", [v
|
|
|
18
18
|
/** The newly created page. */
|
|
19
19
|
readonly page: v.ObjectSchema<{
|
|
20
20
|
readonly object: v.LiteralSchema<"page", undefined>;
|
|
21
|
-
readonly id: v.
|
|
21
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionPageId">]>;
|
|
22
22
|
readonly parent: v.VariantSchema<"type", [v.ObjectSchema<{
|
|
23
23
|
readonly type: v.LiteralSchema<"page_id", undefined>;
|
|
24
|
-
readonly page_id: v.
|
|
24
|
+
readonly page_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionPageId">]>;
|
|
25
25
|
}, undefined>, v.ObjectSchema<{
|
|
26
26
|
readonly type: v.LiteralSchema<"data_source_id", undefined>;
|
|
27
|
-
readonly data_source_id: v.
|
|
27
|
+
readonly data_source_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionDataSourceId">]>;
|
|
28
28
|
}, undefined>, v.ObjectSchema<{
|
|
29
29
|
readonly type: v.LiteralSchema<"workspace", undefined>;
|
|
30
30
|
readonly workspace: v.LiteralSchema<true, undefined>;
|
|
31
31
|
}, undefined>, v.ObjectSchema<{
|
|
32
32
|
readonly type: v.LiteralSchema<"block_id", undefined>;
|
|
33
|
-
readonly block_id: v.
|
|
33
|
+
readonly block_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionBlockId">]>;
|
|
34
34
|
}, undefined>, v.ObjectSchema<{
|
|
35
35
|
readonly type: v.LiteralSchema<"agent_id", undefined>;
|
|
36
|
-
readonly agent_id: v.
|
|
36
|
+
readonly agent_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionAgentId">]>;
|
|
37
37
|
}, undefined>], undefined>;
|
|
38
38
|
readonly properties: v.RecordSchema<v.StringSchema<undefined>, v.VariantSchema<"type", [v.ObjectSchema<{
|
|
39
39
|
readonly type: v.LiteralSchema<"title", undefined>;
|
|
@@ -6,7 +6,7 @@ export declare const currentUserChangedMessageSchema: v.ObjectSchema<{
|
|
|
6
6
|
readonly type: v.LiteralSchema<"currentUserChanged", undefined>;
|
|
7
7
|
readonly currentUser: v.ObjectSchema<{
|
|
8
8
|
readonly object: v.LiteralSchema<"user", undefined>;
|
|
9
|
-
readonly id: v.StringSchema<undefined>;
|
|
9
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionUserId">]>;
|
|
10
10
|
readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
11
11
|
readonly avatar_url: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
12
12
|
readonly type: v.LiteralSchema<"person", undefined>;
|
|
@@ -9,12 +9,12 @@ export declare const dataSourcesChangedMessageSchema: v.ObjectSchema<{
|
|
|
9
9
|
readonly dataSources: v.ObjectSchema<{
|
|
10
10
|
readonly bindings: v.RecordSchema<v.StringSchema<undefined>, v.ObjectSchema<{
|
|
11
11
|
readonly collectionPointer: v.OptionalSchema<v.ObjectSchema<{
|
|
12
|
-
readonly id: v.
|
|
12
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionDataSourceId">]>;
|
|
13
13
|
readonly table: v.StringSchema<undefined>;
|
|
14
|
-
readonly spaceId: v.OptionalSchema<v.
|
|
14
|
+
readonly spaceId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionSpaceId">]>, undefined>;
|
|
15
15
|
}, undefined>, undefined>;
|
|
16
16
|
readonly collectionSchema: v.OptionalSchema<v.ObjectSchema<{
|
|
17
|
-
readonly id: v.OptionalSchema<v.
|
|
17
|
+
readonly id: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionDataSourceId">]>, undefined>;
|
|
18
18
|
readonly propertiesById: v.RecordSchema<v.StringSchema<undefined>, v.VariantSchema<"type", [v.ObjectSchema<{
|
|
19
19
|
readonly type: v.LiteralSchema<"title", undefined>;
|
|
20
20
|
readonly name: v.StringSchema<undefined>;
|