ncblock 0.0.1
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 +286 -0
- package/dist/bridge/context.d.ts +44 -0
- package/dist/bridge/context.d.ts.map +1 -0
- package/dist/bridge/context.js +42 -0
- package/dist/bridge/dataSources/dataSource.d.ts +732 -0
- package/dist/bridge/dataSources/dataSource.d.ts.map +1 -0
- package/dist/bridge/dataSources/dataSource.js +37 -0
- package/dist/bridge/dataSources/dataSourcePage.d.ts +117 -0
- package/dist/bridge/dataSources/dataSourcePage.d.ts.map +1 -0
- package/dist/bridge/dataSources/dataSourcePage.js +13 -0
- package/dist/bridge/dataSources/dataSourceValue.d.ts +67 -0
- package/dist/bridge/dataSources/dataSourceValue.d.ts.map +1 -0
- package/dist/bridge/dataSources/dataSourceValue.js +14 -0
- package/dist/bridge/dataSources/dateValue.d.ts +158 -0
- package/dist/bridge/dataSources/dateValue.d.ts.map +1 -0
- package/dist/bridge/dataSources/dateValue.js +59 -0
- package/dist/bridge/dataSources/propertySchema.d.ts +191 -0
- package/dist/bridge/dataSources/propertySchema.d.ts.map +1 -0
- package/dist/bridge/dataSources/propertySchema.js +148 -0
- package/dist/bridge/dataSources/recordPointer.d.ts +10 -0
- package/dist/bridge/dataSources/recordPointer.d.ts.map +1 -0
- package/dist/bridge/dataSources/recordPointer.js +8 -0
- package/dist/bridge/ids.d.ts +21 -0
- package/dist/bridge/ids.d.ts.map +1 -0
- package/dist/bridge/ids.js +3 -0
- package/dist/bridge/incomingType.d.ts +10 -0
- package/dist/bridge/incomingType.d.ts.map +1 -0
- package/dist/bridge/incomingType.js +17 -0
- package/dist/bridge/manifest.d.ts +66 -0
- package/dist/bridge/manifest.d.ts.map +1 -0
- package/dist/bridge/manifest.js +40 -0
- package/dist/bridge/messages/contextChanged.d.ts +20 -0
- package/dist/bridge/messages/contextChanged.d.ts.map +1 -0
- package/dist/bridge/messages/contextChanged.js +10 -0
- package/dist/bridge/messages/createPage.d.ts +233 -0
- package/dist/bridge/messages/createPage.d.ts.map +1 -0
- package/dist/bridge/messages/createPage.js +45 -0
- package/dist/bridge/messages/createPageResult.d.ts +198 -0
- package/dist/bridge/messages/createPageResult.d.ts.map +1 -0
- package/dist/bridge/messages/createPageResult.js +20 -0
- package/dist/bridge/messages/dataSourcesChanged.d.ts +158 -0
- package/dist/bridge/messages/dataSourcesChanged.d.ts.map +1 -0
- package/dist/bridge/messages/dataSourcesChanged.js +13 -0
- package/dist/bridge/messages/getPage.d.ts +203 -0
- package/dist/bridge/messages/getPage.d.ts.map +1 -0
- package/dist/bridge/messages/getPage.js +24 -0
- package/dist/bridge/messages/hostToSandbox.d.ts +974 -0
- package/dist/bridge/messages/hostToSandbox.d.ts.map +1 -0
- package/dist/bridge/messages/hostToSandbox.js +24 -0
- package/dist/bridge/messages/init.d.ts +169 -0
- package/dist/bridge/messages/init.d.ts.map +1 -0
- package/dist/bridge/messages/init.js +17 -0
- package/dist/bridge/messages/invalidHostMessage.d.ts +15 -0
- package/dist/bridge/messages/invalidHostMessage.d.ts.map +1 -0
- package/dist/bridge/messages/invalidHostMessage.js +13 -0
- package/dist/bridge/messages/invalidSandboxMessage.d.ts +15 -0
- package/dist/bridge/messages/invalidSandboxMessage.d.ts.map +1 -0
- package/dist/bridge/messages/invalidSandboxMessage.js +13 -0
- package/dist/bridge/messages/queryDataSource.d.ts +13 -0
- package/dist/bridge/messages/queryDataSource.d.ts.map +1 -0
- package/dist/bridge/messages/queryDataSource.js +11 -0
- package/dist/bridge/messages/queryDataSourceResult.d.ts +77 -0
- package/dist/bridge/messages/queryDataSourceResult.d.ts.map +1 -0
- package/dist/bridge/messages/queryDataSourceResult.js +13 -0
- package/dist/bridge/messages/ready.d.ts +41 -0
- package/dist/bridge/messages/ready.d.ts.map +1 -0
- package/dist/bridge/messages/ready.js +22 -0
- package/dist/bridge/messages/resize.d.ts +12 -0
- package/dist/bridge/messages/resize.d.ts.map +1 -0
- package/dist/bridge/messages/resize.js +10 -0
- package/dist/bridge/messages/sandboxToHost.d.ts +389 -0
- package/dist/bridge/messages/sandboxToHost.d.ts.map +1 -0
- package/dist/bridge/messages/sandboxToHost.js +21 -0
- package/dist/bridge/messages/themeChanged.d.ts +11 -0
- package/dist/bridge/messages/themeChanged.d.ts.map +1 -0
- package/dist/bridge/messages/themeChanged.js +10 -0
- package/dist/bridge/messages/updatePage.d.ts +171 -0
- package/dist/bridge/messages/updatePage.d.ts.map +1 -0
- package/dist/bridge/messages/updatePage.js +14 -0
- package/dist/bridge/messages/updatePageResult.d.ts +197 -0
- package/dist/bridge/messages/updatePageResult.d.ts.map +1 -0
- package/dist/bridge/messages/updatePageResult.js +19 -0
- package/dist/bridge/pages/page.d.ts +651 -0
- package/dist/bridge/pages/page.d.ts.map +1 -0
- package/dist/bridge/pages/page.js +229 -0
- package/dist/bridge/pendingRequests.d.ts +14 -0
- package/dist/bridge/pendingRequests.d.ts.map +1 -0
- package/dist/bridge/pendingRequests.js +27 -0
- package/dist/bridge/theme.d.ts +4 -0
- package/dist/bridge/theme.d.ts.map +1 -0
- package/dist/bridge/theme.js +2 -0
- package/dist/host.d.ts +52 -0
- package/dist/host.d.ts.map +1 -0
- package/dist/host.js +32 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/notion.d.ts +113 -0
- package/dist/notion.d.ts.map +1 -0
- package/dist/notion.js +773 -0
- package/dist/pages.d.ts +23 -0
- package/dist/pages.d.ts.map +1 -0
- package/dist/pages.js +30 -0
- package/dist/react.d.ts +171 -0
- package/dist/react.d.ts.map +1 -0
- package/dist/react.js +284 -0
- package/dist/types.d.ts +124 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +1 -0
- package/dist/utils.d.ts +9 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +10 -0
- package/package.json +48 -0
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
2
|
+
/**
|
|
3
|
+
* Message sent by the host whenever the custom block's data-source mapping changes (e.g. a key is
|
|
4
|
+
* added, removed, or remapped). The SDK replaces its list of configured data sources but keeps any
|
|
5
|
+
* in-flight `useDataSource` query state for keys that still exist.
|
|
6
|
+
*/
|
|
7
|
+
export declare const dataSourcesChangedMessageSchema: v.ObjectSchema<{
|
|
8
|
+
readonly type: v.LiteralSchema<"dataSourcesChanged", undefined>;
|
|
9
|
+
readonly dataSources: v.ObjectSchema<{
|
|
10
|
+
readonly bindings: v.RecordSchema<v.StringSchema<undefined>, v.ObjectSchema<{
|
|
11
|
+
readonly collectionPointer: v.OptionalSchema<v.ObjectSchema<{
|
|
12
|
+
readonly id: v.CustomSchema<import("../ids").NotionDataSourceId, v.ErrorMessage<v.CustomIssue> | undefined>;
|
|
13
|
+
readonly table: v.StringSchema<undefined>;
|
|
14
|
+
readonly spaceId: v.OptionalSchema<v.CustomSchema<import("../ids").NotionSpaceId, v.ErrorMessage<v.CustomIssue> | undefined>, undefined>;
|
|
15
|
+
}, undefined>, undefined>;
|
|
16
|
+
readonly collectionSchema: v.OptionalSchema<v.ObjectSchema<{
|
|
17
|
+
readonly id: v.OptionalSchema<v.CustomSchema<import("../ids").NotionDataSourceId, v.ErrorMessage<v.CustomIssue> | undefined>, undefined>;
|
|
18
|
+
readonly propertiesById: v.RecordSchema<v.StringSchema<undefined>, v.VariantSchema<"type", [v.ObjectSchema<{
|
|
19
|
+
readonly type: v.LiteralSchema<"title", undefined>;
|
|
20
|
+
readonly name: v.StringSchema<undefined>;
|
|
21
|
+
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
22
|
+
}, undefined>, v.ObjectSchema<{
|
|
23
|
+
readonly type: v.LiteralSchema<"rich_text", undefined>;
|
|
24
|
+
readonly name: v.StringSchema<undefined>;
|
|
25
|
+
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
26
|
+
}, undefined>, v.ObjectSchema<{
|
|
27
|
+
readonly type: v.LiteralSchema<"number", undefined>;
|
|
28
|
+
readonly name: v.StringSchema<undefined>;
|
|
29
|
+
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
30
|
+
}, undefined>, v.ObjectSchema<{
|
|
31
|
+
readonly type: v.LiteralSchema<"checkbox", undefined>;
|
|
32
|
+
readonly name: v.StringSchema<undefined>;
|
|
33
|
+
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
34
|
+
}, undefined>, v.ObjectSchema<{
|
|
35
|
+
readonly type: v.LiteralSchema<"url", undefined>;
|
|
36
|
+
readonly name: v.StringSchema<undefined>;
|
|
37
|
+
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
38
|
+
}, undefined>, v.ObjectSchema<{
|
|
39
|
+
readonly type: v.LiteralSchema<"email", undefined>;
|
|
40
|
+
readonly name: v.StringSchema<undefined>;
|
|
41
|
+
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
42
|
+
}, undefined>, v.ObjectSchema<{
|
|
43
|
+
readonly type: v.LiteralSchema<"phone_number", undefined>;
|
|
44
|
+
readonly name: v.StringSchema<undefined>;
|
|
45
|
+
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
46
|
+
}, undefined>, v.ObjectSchema<{
|
|
47
|
+
readonly type: v.LiteralSchema<"select", undefined>;
|
|
48
|
+
readonly options: v.ArraySchema<v.ObjectSchema<{
|
|
49
|
+
readonly id: v.StringSchema<undefined>;
|
|
50
|
+
readonly name: v.StringSchema<undefined>;
|
|
51
|
+
readonly color: v.OptionalSchema<v.PicklistSchema<["default", "gray", "brown", "orange", "yellow", "green", "blue", "purple", "pink", "red", "gray_background", "brown_background", "orange_background", "yellow_background", "green_background", "blue_background", "purple_background", "pink_background", "red_background", "default_background"], undefined>, undefined>;
|
|
52
|
+
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
53
|
+
}, undefined>, undefined>;
|
|
54
|
+
readonly name: v.StringSchema<undefined>;
|
|
55
|
+
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
56
|
+
}, undefined>, v.ObjectSchema<{
|
|
57
|
+
readonly type: v.LiteralSchema<"multi_select", undefined>;
|
|
58
|
+
readonly options: v.ArraySchema<v.ObjectSchema<{
|
|
59
|
+
readonly id: v.StringSchema<undefined>;
|
|
60
|
+
readonly name: v.StringSchema<undefined>;
|
|
61
|
+
readonly color: v.OptionalSchema<v.PicklistSchema<["default", "gray", "brown", "orange", "yellow", "green", "blue", "purple", "pink", "red", "gray_background", "brown_background", "orange_background", "yellow_background", "green_background", "blue_background", "purple_background", "pink_background", "red_background", "default_background"], undefined>, undefined>;
|
|
62
|
+
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
63
|
+
}, undefined>, undefined>;
|
|
64
|
+
readonly name: v.StringSchema<undefined>;
|
|
65
|
+
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
66
|
+
}, undefined>, v.ObjectSchema<{
|
|
67
|
+
readonly type: v.LiteralSchema<"status", undefined>;
|
|
68
|
+
readonly options: v.ArraySchema<v.ObjectSchema<{
|
|
69
|
+
readonly id: v.StringSchema<undefined>;
|
|
70
|
+
readonly name: v.StringSchema<undefined>;
|
|
71
|
+
readonly color: v.OptionalSchema<v.PicklistSchema<["default", "gray", "brown", "orange", "yellow", "green", "blue", "purple", "pink", "red", "gray_background", "brown_background", "orange_background", "yellow_background", "green_background", "blue_background", "purple_background", "pink_background", "red_background", "default_background"], undefined>, undefined>;
|
|
72
|
+
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
73
|
+
}, undefined>, undefined>;
|
|
74
|
+
readonly groups: v.ArraySchema<v.ObjectSchema<{
|
|
75
|
+
readonly id: v.StringSchema<undefined>;
|
|
76
|
+
readonly name: v.StringSchema<undefined>;
|
|
77
|
+
readonly color: v.OptionalSchema<v.PicklistSchema<["default", "gray", "brown", "orange", "yellow", "green", "blue", "purple", "pink", "red", "gray_background", "brown_background", "orange_background", "yellow_background", "green_background", "blue_background", "purple_background", "pink_background", "red_background", "default_background"], undefined>, undefined>;
|
|
78
|
+
readonly option_ids: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
79
|
+
}, undefined>, undefined>;
|
|
80
|
+
readonly name: v.StringSchema<undefined>;
|
|
81
|
+
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
82
|
+
}, undefined>, v.ObjectSchema<{
|
|
83
|
+
readonly type: v.LiteralSchema<"date", undefined>;
|
|
84
|
+
readonly name: v.StringSchema<undefined>;
|
|
85
|
+
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
86
|
+
}, undefined>, v.ObjectSchema<{
|
|
87
|
+
readonly type: v.LiteralSchema<"people", undefined>;
|
|
88
|
+
readonly name: v.StringSchema<undefined>;
|
|
89
|
+
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
90
|
+
}, undefined>, v.ObjectSchema<{
|
|
91
|
+
readonly type: v.LiteralSchema<"files", undefined>;
|
|
92
|
+
readonly name: v.StringSchema<undefined>;
|
|
93
|
+
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
94
|
+
}, undefined>, v.ObjectSchema<{
|
|
95
|
+
readonly type: v.LiteralSchema<"unique_id", undefined>;
|
|
96
|
+
readonly name: v.StringSchema<undefined>;
|
|
97
|
+
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
98
|
+
}, undefined>, v.ObjectSchema<{
|
|
99
|
+
readonly type: v.LiteralSchema<"relation", undefined>;
|
|
100
|
+
readonly data_source_id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
101
|
+
readonly dual_property: v.OptionalSchema<v.ObjectSchema<{
|
|
102
|
+
readonly synced_property_id: v.StringSchema<undefined>;
|
|
103
|
+
readonly synced_property_name: v.StringSchema<undefined>;
|
|
104
|
+
}, undefined>, undefined>;
|
|
105
|
+
readonly name: v.StringSchema<undefined>;
|
|
106
|
+
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
107
|
+
}, undefined>, v.ObjectSchema<{
|
|
108
|
+
readonly type: v.LiteralSchema<"place", undefined>;
|
|
109
|
+
readonly name: v.StringSchema<undefined>;
|
|
110
|
+
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
111
|
+
}, undefined>, v.ObjectSchema<{
|
|
112
|
+
readonly type: v.LiteralSchema<"formula", undefined>;
|
|
113
|
+
readonly name: v.StringSchema<undefined>;
|
|
114
|
+
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
115
|
+
}, undefined>, v.ObjectSchema<{
|
|
116
|
+
readonly type: v.LiteralSchema<"rollup", undefined>;
|
|
117
|
+
readonly name: v.StringSchema<undefined>;
|
|
118
|
+
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
119
|
+
}, undefined>, v.ObjectSchema<{
|
|
120
|
+
readonly type: v.LiteralSchema<"button", undefined>;
|
|
121
|
+
readonly name: v.StringSchema<undefined>;
|
|
122
|
+
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
123
|
+
}, undefined>, v.ObjectSchema<{
|
|
124
|
+
readonly type: v.LiteralSchema<"verification", undefined>;
|
|
125
|
+
readonly name: v.StringSchema<undefined>;
|
|
126
|
+
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
127
|
+
}, undefined>, v.ObjectSchema<{
|
|
128
|
+
readonly type: v.LiteralSchema<"last_visited_time", undefined>;
|
|
129
|
+
readonly name: v.StringSchema<undefined>;
|
|
130
|
+
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
131
|
+
}, undefined>, v.ObjectSchema<{
|
|
132
|
+
readonly type: v.LiteralSchema<"location", undefined>;
|
|
133
|
+
readonly name: v.StringSchema<undefined>;
|
|
134
|
+
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
135
|
+
}, undefined>, v.ObjectSchema<{
|
|
136
|
+
readonly type: v.LiteralSchema<"created_time", undefined>;
|
|
137
|
+
readonly name: v.StringSchema<undefined>;
|
|
138
|
+
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
139
|
+
}, undefined>, v.ObjectSchema<{
|
|
140
|
+
readonly type: v.LiteralSchema<"last_edited_time", undefined>;
|
|
141
|
+
readonly name: v.StringSchema<undefined>;
|
|
142
|
+
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
143
|
+
}, undefined>, v.ObjectSchema<{
|
|
144
|
+
readonly type: v.LiteralSchema<"created_by", undefined>;
|
|
145
|
+
readonly name: v.StringSchema<undefined>;
|
|
146
|
+
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
147
|
+
}, undefined>, v.ObjectSchema<{
|
|
148
|
+
readonly type: v.LiteralSchema<"last_edited_by", undefined>;
|
|
149
|
+
readonly name: v.StringSchema<undefined>;
|
|
150
|
+
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
151
|
+
}, undefined>], undefined>, undefined>;
|
|
152
|
+
}, undefined>, undefined>;
|
|
153
|
+
readonly propertyIdsByKey: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.OptionalSchema<v.StringSchema<undefined>, undefined>, undefined>, undefined>;
|
|
154
|
+
}, undefined>, undefined>;
|
|
155
|
+
}, undefined>;
|
|
156
|
+
}, undefined>;
|
|
157
|
+
export type DataSourcesChangedMessage = v.InferOutput<typeof dataSourcesChangedMessageSchema>;
|
|
158
|
+
//# sourceMappingURL=dataSourcesChanged.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataSourcesChanged.d.ts","sourceRoot":"","sources":["../../../bridge/messages/dataSourcesChanged.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAG5B;;;;GAIG;AACH,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAK1C,CAAA;AAEF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,WAAW,CACpD,OAAO,+BAA+B,CACtC,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
2
|
+
import { notionDataSourceBindingsSchema } from "../dataSources/dataSource";
|
|
3
|
+
/**
|
|
4
|
+
* Message sent by the host whenever the custom block's data-source mapping changes (e.g. a key is
|
|
5
|
+
* added, removed, or remapped). The SDK replaces its list of configured data sources but keeps any
|
|
6
|
+
* in-flight `useDataSource` query state for keys that still exist.
|
|
7
|
+
*/
|
|
8
|
+
export const dataSourcesChangedMessageSchema = v.object({
|
|
9
|
+
type: v.literal("dataSourcesChanged"),
|
|
10
|
+
dataSources: v.object({
|
|
11
|
+
bindings: notionDataSourceBindingsSchema,
|
|
12
|
+
}),
|
|
13
|
+
});
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
2
|
+
/**
|
|
3
|
+
* Sandbox -> host: fetch a page by ID.
|
|
4
|
+
*/
|
|
5
|
+
export declare const getPageMessageSchema: v.ObjectSchema<{
|
|
6
|
+
readonly type: v.LiteralSchema<"getPage", undefined>;
|
|
7
|
+
readonly requestId: v.StringSchema<undefined>;
|
|
8
|
+
readonly pageId: v.StringSchema<undefined>;
|
|
9
|
+
}, undefined>;
|
|
10
|
+
export type GetPageMessage = v.InferOutput<typeof getPageMessageSchema>;
|
|
11
|
+
export declare const getPageResultMessageSchema: v.VariantSchema<"status", [v.ObjectSchema<{
|
|
12
|
+
readonly type: v.LiteralSchema<"getPageResult", undefined>;
|
|
13
|
+
readonly requestId: v.StringSchema<undefined>;
|
|
14
|
+
readonly status: v.LiteralSchema<"success", undefined>;
|
|
15
|
+
readonly page: v.ObjectSchema<{
|
|
16
|
+
readonly object: v.LiteralSchema<"page", undefined>;
|
|
17
|
+
readonly id: v.StringSchema<undefined>;
|
|
18
|
+
readonly parent: v.VariantSchema<"type", [v.ObjectSchema<{
|
|
19
|
+
readonly type: v.LiteralSchema<"page_id", undefined>;
|
|
20
|
+
readonly page_id: v.StringSchema<undefined>;
|
|
21
|
+
}, undefined>, v.ObjectSchema<{
|
|
22
|
+
readonly type: v.LiteralSchema<"data_source_id", undefined>;
|
|
23
|
+
readonly data_source_id: v.StringSchema<undefined>;
|
|
24
|
+
}, undefined>, v.ObjectSchema<{
|
|
25
|
+
readonly type: v.LiteralSchema<"workspace", undefined>;
|
|
26
|
+
readonly workspace: v.LiteralSchema<true, undefined>;
|
|
27
|
+
}, undefined>, v.ObjectSchema<{
|
|
28
|
+
readonly type: v.LiteralSchema<"block_id", undefined>;
|
|
29
|
+
readonly block_id: v.StringSchema<undefined>;
|
|
30
|
+
}, undefined>], undefined>;
|
|
31
|
+
readonly properties: v.RecordSchema<v.StringSchema<undefined>, v.VariantSchema<"type", [v.ObjectSchema<{
|
|
32
|
+
readonly type: v.LiteralSchema<"title", undefined>;
|
|
33
|
+
readonly title: v.ArraySchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
|
|
34
|
+
readonly id: v.StringSchema<undefined>;
|
|
35
|
+
}, undefined>, v.ObjectSchema<{
|
|
36
|
+
readonly type: v.LiteralSchema<"rich_text", undefined>;
|
|
37
|
+
readonly rich_text: v.ArraySchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
|
|
38
|
+
readonly id: v.StringSchema<undefined>;
|
|
39
|
+
}, undefined>, v.ObjectSchema<{
|
|
40
|
+
readonly type: v.LiteralSchema<"number", undefined>;
|
|
41
|
+
readonly number: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
|
|
42
|
+
readonly id: v.StringSchema<undefined>;
|
|
43
|
+
}, undefined>, v.ObjectSchema<{
|
|
44
|
+
readonly type: v.LiteralSchema<"url", undefined>;
|
|
45
|
+
readonly url: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
46
|
+
readonly id: v.StringSchema<undefined>;
|
|
47
|
+
}, undefined>, v.ObjectSchema<{
|
|
48
|
+
readonly type: v.LiteralSchema<"email", undefined>;
|
|
49
|
+
readonly email: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
50
|
+
readonly id: v.StringSchema<undefined>;
|
|
51
|
+
}, undefined>, v.ObjectSchema<{
|
|
52
|
+
readonly type: v.LiteralSchema<"phone_number", undefined>;
|
|
53
|
+
readonly phone_number: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
54
|
+
readonly id: v.StringSchema<undefined>;
|
|
55
|
+
}, undefined>, v.ObjectSchema<{
|
|
56
|
+
readonly type: v.LiteralSchema<"checkbox", undefined>;
|
|
57
|
+
readonly checkbox: v.BooleanSchema<undefined>;
|
|
58
|
+
readonly id: v.StringSchema<undefined>;
|
|
59
|
+
}, undefined>, v.ObjectSchema<{
|
|
60
|
+
readonly type: v.LiteralSchema<"select", undefined>;
|
|
61
|
+
readonly select: v.NullableSchema<v.UnionSchema<[v.ObjectSchema<{
|
|
62
|
+
readonly id: v.StringSchema<undefined>;
|
|
63
|
+
readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
64
|
+
readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
65
|
+
readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
66
|
+
}, undefined>, v.ObjectSchema<{
|
|
67
|
+
readonly name: v.StringSchema<undefined>;
|
|
68
|
+
readonly id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
69
|
+
readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
70
|
+
readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
71
|
+
}, undefined>], undefined>, undefined>;
|
|
72
|
+
readonly id: v.StringSchema<undefined>;
|
|
73
|
+
}, undefined>, v.ObjectSchema<{
|
|
74
|
+
readonly type: v.LiteralSchema<"status", undefined>;
|
|
75
|
+
readonly status: v.NullableSchema<v.UnionSchema<[v.ObjectSchema<{
|
|
76
|
+
readonly id: v.StringSchema<undefined>;
|
|
77
|
+
readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
78
|
+
readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
79
|
+
readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
80
|
+
}, undefined>, v.ObjectSchema<{
|
|
81
|
+
readonly name: v.StringSchema<undefined>;
|
|
82
|
+
readonly id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
83
|
+
readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
84
|
+
readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
85
|
+
}, undefined>], undefined>, undefined>;
|
|
86
|
+
readonly id: v.StringSchema<undefined>;
|
|
87
|
+
}, undefined>, v.ObjectSchema<{
|
|
88
|
+
readonly type: v.LiteralSchema<"multi_select", undefined>;
|
|
89
|
+
readonly multi_select: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
|
|
90
|
+
readonly id: v.StringSchema<undefined>;
|
|
91
|
+
readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
92
|
+
readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
93
|
+
readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
94
|
+
}, undefined>, v.ObjectSchema<{
|
|
95
|
+
readonly name: v.StringSchema<undefined>;
|
|
96
|
+
readonly id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
97
|
+
readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
98
|
+
readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
99
|
+
}, undefined>], undefined>, undefined>;
|
|
100
|
+
readonly id: v.StringSchema<undefined>;
|
|
101
|
+
}, undefined>, v.ObjectSchema<{
|
|
102
|
+
readonly type: v.LiteralSchema<"date", undefined>;
|
|
103
|
+
readonly date: v.NullableSchema<v.ObjectSchema<{
|
|
104
|
+
readonly start: v.StringSchema<undefined>;
|
|
105
|
+
readonly end: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
106
|
+
readonly time_zone: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
107
|
+
}, undefined>, undefined>;
|
|
108
|
+
readonly id: v.StringSchema<undefined>;
|
|
109
|
+
}, undefined>, v.ObjectSchema<{
|
|
110
|
+
readonly type: v.LiteralSchema<"people", undefined>;
|
|
111
|
+
readonly people: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
|
|
112
|
+
readonly object: v.OptionalSchema<v.LiteralSchema<"user", undefined>, undefined>;
|
|
113
|
+
readonly id: v.StringSchema<undefined>;
|
|
114
|
+
}, undefined>, v.ObjectSchema<{
|
|
115
|
+
readonly object: v.LiteralSchema<"group", undefined>;
|
|
116
|
+
readonly id: v.StringSchema<undefined>;
|
|
117
|
+
readonly name: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
118
|
+
}, undefined>], undefined>, undefined>;
|
|
119
|
+
readonly id: v.StringSchema<undefined>;
|
|
120
|
+
}, undefined>, v.ObjectSchema<{
|
|
121
|
+
readonly type: v.LiteralSchema<"relation", undefined>;
|
|
122
|
+
readonly has_more: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
123
|
+
readonly relation: v.ArraySchema<v.ObjectSchema<{
|
|
124
|
+
readonly id: v.StringSchema<undefined>;
|
|
125
|
+
}, undefined>, undefined>;
|
|
126
|
+
readonly id: v.StringSchema<undefined>;
|
|
127
|
+
}, undefined>, v.ObjectSchema<{
|
|
128
|
+
readonly type: v.LiteralSchema<"files", undefined>;
|
|
129
|
+
readonly files: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
|
|
130
|
+
readonly type: v.LiteralSchema<"external", undefined>;
|
|
131
|
+
readonly name: v.StringSchema<undefined>;
|
|
132
|
+
readonly external: v.ObjectSchema<{
|
|
133
|
+
readonly url: v.StringSchema<undefined>;
|
|
134
|
+
}, undefined>;
|
|
135
|
+
}, undefined>, v.ObjectSchema<{
|
|
136
|
+
readonly type: v.LiteralSchema<"file", undefined>;
|
|
137
|
+
readonly name: v.StringSchema<undefined>;
|
|
138
|
+
readonly file: v.ObjectSchema<{
|
|
139
|
+
readonly url: v.StringSchema<undefined>;
|
|
140
|
+
readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
141
|
+
}, undefined>;
|
|
142
|
+
}, undefined>], undefined>, undefined>;
|
|
143
|
+
readonly id: v.StringSchema<undefined>;
|
|
144
|
+
}, undefined>, v.ObjectSchema<{
|
|
145
|
+
readonly type: v.LiteralSchema<"place", undefined>;
|
|
146
|
+
readonly place: v.NullableSchema<v.ObjectSchema<{
|
|
147
|
+
readonly lat: v.NumberSchema<undefined>;
|
|
148
|
+
readonly lon: v.NumberSchema<undefined>;
|
|
149
|
+
readonly name: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
150
|
+
readonly address: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
151
|
+
readonly aws_place_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
152
|
+
readonly google_place_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
153
|
+
}, undefined>, undefined>;
|
|
154
|
+
readonly id: v.StringSchema<undefined>;
|
|
155
|
+
}, undefined>], undefined>, undefined>;
|
|
156
|
+
readonly created_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
157
|
+
readonly last_edited_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
158
|
+
readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.ObjectSchema<{
|
|
159
|
+
readonly type: v.LiteralSchema<"emoji", undefined>;
|
|
160
|
+
readonly emoji: v.StringSchema<undefined>;
|
|
161
|
+
}, undefined>, v.ObjectSchema<{
|
|
162
|
+
readonly type: v.LiteralSchema<"custom_emoji", undefined>;
|
|
163
|
+
readonly custom_emoji: v.ObjectSchema<{
|
|
164
|
+
readonly id: v.StringSchema<undefined>;
|
|
165
|
+
readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
166
|
+
readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
167
|
+
}, undefined>;
|
|
168
|
+
}, undefined>, v.ObjectSchema<{
|
|
169
|
+
readonly type: v.LiteralSchema<"external", undefined>;
|
|
170
|
+
readonly external: v.ObjectSchema<{
|
|
171
|
+
readonly url: v.StringSchema<undefined>;
|
|
172
|
+
}, undefined>;
|
|
173
|
+
}, undefined>, v.ObjectSchema<{
|
|
174
|
+
readonly type: v.LiteralSchema<"file", undefined>;
|
|
175
|
+
readonly file: v.ObjectSchema<{
|
|
176
|
+
readonly url: v.StringSchema<undefined>;
|
|
177
|
+
readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
178
|
+
}, undefined>;
|
|
179
|
+
}, undefined>], undefined>, undefined>;
|
|
180
|
+
readonly cover: v.OptionalSchema<v.VariantSchema<"type", [v.ObjectSchema<{
|
|
181
|
+
readonly type: v.LiteralSchema<"external", undefined>;
|
|
182
|
+
readonly external: v.ObjectSchema<{
|
|
183
|
+
readonly url: v.StringSchema<undefined>;
|
|
184
|
+
}, undefined>;
|
|
185
|
+
}, undefined>, v.ObjectSchema<{
|
|
186
|
+
readonly type: v.LiteralSchema<"file", undefined>;
|
|
187
|
+
readonly file: v.ObjectSchema<{
|
|
188
|
+
readonly url: v.StringSchema<undefined>;
|
|
189
|
+
readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
190
|
+
}, undefined>;
|
|
191
|
+
}, undefined>], undefined>, undefined>;
|
|
192
|
+
readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
193
|
+
readonly public_url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
194
|
+
readonly in_trash: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
195
|
+
}, undefined>;
|
|
196
|
+
}, undefined>, v.ObjectSchema<{
|
|
197
|
+
readonly type: v.LiteralSchema<"getPageResult", undefined>;
|
|
198
|
+
readonly requestId: v.StringSchema<undefined>;
|
|
199
|
+
readonly status: v.LiteralSchema<"error", undefined>;
|
|
200
|
+
readonly error: v.StringSchema<undefined>;
|
|
201
|
+
}, undefined>], undefined>;
|
|
202
|
+
export type GetPageResultMessage = v.InferOutput<typeof getPageResultMessageSchema>;
|
|
203
|
+
//# sourceMappingURL=getPage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getPage.d.ts","sourceRoot":"","sources":["../../../bridge/messages/getPage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAG5B;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;aAI/B,CAAA;AAEF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEvE,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAarC,CAAA;AAEF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,WAAW,CAC/C,OAAO,0BAA0B,CACjC,CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
2
|
+
import { notionPageSchema } from "../pages/page";
|
|
3
|
+
/**
|
|
4
|
+
* Sandbox -> host: fetch a page by ID.
|
|
5
|
+
*/
|
|
6
|
+
export const getPageMessageSchema = v.object({
|
|
7
|
+
type: v.literal("getPage"),
|
|
8
|
+
requestId: v.string(),
|
|
9
|
+
pageId: v.string(),
|
|
10
|
+
});
|
|
11
|
+
export const getPageResultMessageSchema = v.variant("status", [
|
|
12
|
+
v.object({
|
|
13
|
+
type: v.literal("getPageResult"),
|
|
14
|
+
requestId: v.string(),
|
|
15
|
+
status: v.literal("success"),
|
|
16
|
+
page: notionPageSchema,
|
|
17
|
+
}),
|
|
18
|
+
v.object({
|
|
19
|
+
type: v.literal("getPageResult"),
|
|
20
|
+
requestId: v.string(),
|
|
21
|
+
status: v.literal("error"),
|
|
22
|
+
error: v.string(),
|
|
23
|
+
}),
|
|
24
|
+
]);
|