@notionhq/custom-blocks-host 0.3.5 → 0.3.7

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.
Files changed (51) hide show
  1. package/README.md +5 -0
  2. package/dist/browser.js +1 -1
  3. package/dist/dateValue.d.ts +11 -0
  4. package/dist/dateValue.d.ts.map +1 -0
  5. package/dist/dateValue.js +96 -0
  6. package/dist/index.d.ts +3 -2
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js +1 -0
  9. package/dist/lifecycle/legacyPage.d.ts +4 -2
  10. package/dist/lifecycle/legacyPage.d.ts.map +1 -1
  11. package/dist/lifecycle/legacyPage.js +14 -62
  12. package/dist/lifecycle/normalizeHostToSandboxMessage.d.ts.map +1 -1
  13. package/dist/lifecycle/normalizeHostToSandboxMessage.js +8 -2
  14. package/dist/lifecycle/normalizePage.d.ts +7 -0
  15. package/dist/lifecycle/normalizePage.d.ts.map +1 -0
  16. package/dist/lifecycle/normalizePage.js +22 -0
  17. package/dist/messages/types.d.ts +1 -2
  18. package/dist/messages/types.d.ts.map +1 -1
  19. package/dist/protocol/dataSources/dataSourcePage.d.ts +0 -160
  20. package/dist/protocol/dataSources/dataSourcePage.js +0 -7
  21. package/dist/protocol/dataSources/dateValue.d.ts +2 -2
  22. package/dist/protocol/dataSources/dateValue.js +9 -7
  23. package/dist/protocol/messages/createPage.d.ts +40 -2
  24. package/dist/protocol/messages/createPage.js +2 -2
  25. package/dist/protocol/messages/createPageResult.d.ts +584 -3
  26. package/dist/protocol/messages/createPageResult.js +17 -2
  27. package/dist/protocol/messages/getPage.d.ts +584 -3
  28. package/dist/protocol/messages/getPage.js +18 -3
  29. package/dist/protocol/messages/hostToSandbox.d.ts +1638 -376
  30. package/dist/protocol/messages/hostToSandbox.js +9 -6
  31. package/dist/protocol/messages/queryDataSourceResult.d.ts +222 -10
  32. package/dist/protocol/messages/queryDataSourceResult.js +4 -6
  33. package/dist/protocol/messages/sandboxToHost.d.ts +82 -4
  34. package/dist/protocol/messages/updatePage.d.ts +41 -2
  35. package/dist/protocol/messages/updatePage.js +4 -3
  36. package/dist/protocol/messages/updatePageResult.d.ts +583 -3
  37. package/dist/protocol/messages/updatePageResult.js +16 -2
  38. package/dist/protocol/pages/page.d.ts +622 -14
  39. package/dist/protocol/pages/page.js +41 -4
  40. package/dist/protocol/protocolVersion.js +1 -1
  41. package/package.json +1 -1
  42. package/src/dateValue.ts +120 -0
  43. package/src/index.ts +7 -4
  44. package/src/lifecycle/legacyPage.ts +30 -76
  45. package/src/lifecycle/normalizeHostToSandboxMessage.ts +13 -2
  46. package/src/lifecycle/normalizePage.ts +35 -0
  47. package/src/messages/types.ts +1 -1
  48. package/dist/lifecycle/normalizeQueryPage.d.ts +0 -3
  49. package/dist/lifecycle/normalizeQueryPage.d.ts.map +0 -1
  50. package/dist/lifecycle/normalizeQueryPage.js +0 -13
  51. package/src/lifecycle/normalizeQueryPage.ts +0 -25
@@ -13,7 +13,7 @@ import type { UpdatePageMessage, updatePageMessageSchema } from "../protocol/mes
13
13
  import type { CustomBlockUpdatePageErrorInfo, updatePageResultMessageSchema } from "../protocol/messages/updatePageResult.js";
14
14
  import type { InferInput } from "valibot";
15
15
  import type { CustomBlockHostQueryDataSourceResult } from "../queries/types.js";
16
- type MaybePromise<T> = T | Promise<T>;
16
+ export type MaybePromise<T> = T | Promise<T>;
17
17
  /**
18
18
  * Host results use InferInput so adapters can return plain string IDs.
19
19
  * The runtime validates results before sending them and assigns protocol ID brands.
@@ -62,5 +62,4 @@ export type OpenExternalUrlMessageInput = InferInput<typeof openExternalUrlMessa
62
62
  export type QueryDataSourceMessageInput = InferInput<typeof queryDataSourceMessageSchema>;
63
63
  export type ResizeMessageInput = InferInput<typeof resizeMessageSchema>;
64
64
  export type UpdatePageMessageInput = InferInput<typeof updatePageMessageSchema>;
65
- export {};
66
65
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot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oBAAoB,CAAC,CAAA;AAEzE,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAE7E,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAE3E,MAAM,MAAM,2BAA2B,GAAG,UAAU,CACnD,OAAO,4BAA4B,CACnC,CAAA;AAED,MAAM,MAAM,2BAA2B,GAAG,UAAU,CACnD,OAAO,4BAA4B,CACnC,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAEvE,MAAM,MAAM,sBAAsB,GAAG,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAA"}
@@ -71,164 +71,4 @@ export declare const legacyNotionDataSourcePageBridgeSchema: v.ObjectSchema<{
71
71
  readonly table: v.StringSchema<undefined>;
72
72
  }, undefined>, undefined>], undefined>, undefined>, undefined>;
73
73
  }, undefined>;
74
- export declare const notionDataSourcePageBridgeSchema: v.ObjectSchema<{
75
- readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionPageId">]>;
76
- readonly is_archived: v.BooleanSchema<undefined>;
77
- readonly in_trash: v.BooleanSchema<undefined>;
78
- readonly properties: v.RecordSchema<v.StringSchema<undefined>, v.OptionalSchema<v.VariantSchema<"type", [v.ObjectSchema<{
79
- readonly id: v.StringSchema<undefined>;
80
- readonly type: v.LiteralSchema<"title", undefined>;
81
- readonly title: v.ArraySchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
82
- }, undefined>, v.ObjectSchema<{
83
- readonly id: v.StringSchema<undefined>;
84
- readonly type: v.LiteralSchema<"rich_text", undefined>;
85
- readonly rich_text: v.ArraySchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
86
- }, undefined>, v.ObjectSchema<{
87
- readonly id: v.StringSchema<undefined>;
88
- readonly type: v.LiteralSchema<"number", undefined>;
89
- readonly number: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
90
- }, undefined>, v.ObjectSchema<{
91
- readonly id: v.StringSchema<undefined>;
92
- readonly type: v.LiteralSchema<"url", undefined>;
93
- readonly url: v.NullableSchema<v.StringSchema<undefined>, undefined>;
94
- }, undefined>, v.ObjectSchema<{
95
- readonly id: v.StringSchema<undefined>;
96
- readonly type: v.LiteralSchema<"email", undefined>;
97
- readonly email: v.NullableSchema<v.StringSchema<undefined>, undefined>;
98
- }, undefined>, v.ObjectSchema<{
99
- readonly id: v.StringSchema<undefined>;
100
- readonly type: v.LiteralSchema<"phone_number", undefined>;
101
- readonly phone_number: v.NullableSchema<v.StringSchema<undefined>, undefined>;
102
- }, undefined>, v.ObjectSchema<{
103
- readonly id: v.StringSchema<undefined>;
104
- readonly type: v.LiteralSchema<"checkbox", undefined>;
105
- readonly checkbox: v.BooleanSchema<undefined>;
106
- }, undefined>, v.ObjectSchema<{
107
- readonly id: v.StringSchema<undefined>;
108
- readonly type: v.LiteralSchema<"select", undefined>;
109
- readonly select: v.NullableSchema<v.UnionSchema<[v.ObjectSchema<{
110
- readonly id: v.StringSchema<undefined>;
111
- readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
112
- readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
113
- readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
114
- }, undefined>, v.ObjectSchema<{
115
- readonly name: v.StringSchema<undefined>;
116
- readonly id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
117
- readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
118
- readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
119
- }, undefined>], undefined>, undefined>;
120
- }, undefined>, v.ObjectSchema<{
121
- readonly id: v.StringSchema<undefined>;
122
- readonly type: v.LiteralSchema<"status", undefined>;
123
- readonly status: v.NullableSchema<v.UnionSchema<[v.ObjectSchema<{
124
- readonly id: v.StringSchema<undefined>;
125
- readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
126
- readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
127
- readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
128
- }, undefined>, v.ObjectSchema<{
129
- readonly name: v.StringSchema<undefined>;
130
- readonly id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
131
- readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
132
- readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
133
- }, undefined>], undefined>, undefined>;
134
- }, undefined>, v.ObjectSchema<{
135
- readonly id: v.StringSchema<undefined>;
136
- readonly type: v.LiteralSchema<"multi_select", undefined>;
137
- readonly multi_select: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
138
- readonly id: v.StringSchema<undefined>;
139
- readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
140
- readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
141
- readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
142
- }, undefined>, v.ObjectSchema<{
143
- readonly name: v.StringSchema<undefined>;
144
- readonly id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
145
- readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
146
- readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
147
- }, undefined>], undefined>, undefined>;
148
- }, undefined>, v.ObjectSchema<{
149
- readonly id: v.StringSchema<undefined>;
150
- readonly type: v.LiteralSchema<"date", undefined>;
151
- readonly date: v.NullableSchema<v.ObjectSchema<{
152
- readonly start: v.StringSchema<undefined>;
153
- readonly end: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
154
- readonly time_zone: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
155
- }, undefined>, undefined>;
156
- }, undefined>, v.ObjectSchema<{
157
- readonly id: v.StringSchema<undefined>;
158
- readonly type: v.LiteralSchema<"people", undefined>;
159
- readonly people: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
160
- readonly object: v.OptionalSchema<v.LiteralSchema<"user", undefined>, undefined>;
161
- readonly id: v.StringSchema<undefined>;
162
- }, undefined>, v.ObjectSchema<{
163
- readonly object: v.LiteralSchema<"group", undefined>;
164
- readonly id: v.StringSchema<undefined>;
165
- readonly name: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
166
- }, undefined>], undefined>, undefined>;
167
- }, undefined>, v.ObjectSchema<{
168
- readonly id: v.StringSchema<undefined>;
169
- readonly type: v.LiteralSchema<"relation", undefined>;
170
- readonly has_more: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
171
- readonly relation: v.ArraySchema<v.ObjectSchema<{
172
- readonly id: v.StringSchema<undefined>;
173
- }, undefined>, undefined>;
174
- }, undefined>, v.ObjectSchema<{
175
- readonly id: v.StringSchema<undefined>;
176
- readonly type: v.LiteralSchema<"files", undefined>;
177
- readonly files: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
178
- readonly type: v.LiteralSchema<"external", undefined>;
179
- readonly name: v.StringSchema<undefined>;
180
- readonly external: v.ObjectSchema<{
181
- readonly url: v.StringSchema<undefined>;
182
- }, undefined>;
183
- }, undefined>, v.ObjectSchema<{
184
- readonly type: v.LiteralSchema<"file", undefined>;
185
- readonly name: v.StringSchema<undefined>;
186
- readonly file: v.ObjectSchema<{
187
- readonly url: v.StringSchema<undefined>;
188
- readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
189
- }, undefined>;
190
- }, undefined>], undefined>, undefined>;
191
- }, undefined>, v.ObjectSchema<{
192
- readonly id: v.StringSchema<undefined>;
193
- readonly type: v.LiteralSchema<"place", undefined>;
194
- readonly place: v.NullableSchema<v.ObjectSchema<{
195
- readonly lat: v.NumberSchema<undefined>;
196
- readonly lon: v.NumberSchema<undefined>;
197
- readonly name: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
198
- readonly address: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
199
- readonly aws_place_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
200
- readonly google_place_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
201
- }, undefined>, undefined>;
202
- }, undefined>, v.ObjectSchema<{
203
- readonly id: v.StringSchema<undefined>;
204
- readonly type: v.LiteralSchema<"created_time", undefined>;
205
- readonly created_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
206
- }, undefined>, v.ObjectSchema<{
207
- readonly id: v.StringSchema<undefined>;
208
- readonly type: v.LiteralSchema<"last_edited_time", undefined>;
209
- readonly last_edited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
210
- }, undefined>, v.ObjectSchema<{
211
- readonly id: v.StringSchema<undefined>;
212
- readonly type: v.LiteralSchema<"created_by", undefined>;
213
- readonly created_by: v.NullableSchema<v.ObjectSchema<{
214
- readonly id: v.StringSchema<undefined>;
215
- readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
216
- readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
217
- }, undefined>, undefined>;
218
- }, undefined>, v.ObjectSchema<{
219
- readonly id: v.StringSchema<undefined>;
220
- readonly type: v.LiteralSchema<"last_edited_by", undefined>;
221
- readonly last_edited_by: v.NullableSchema<v.ObjectSchema<{
222
- readonly id: v.StringSchema<undefined>;
223
- readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
224
- readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
225
- }, undefined>, undefined>;
226
- }, undefined>, v.ObjectSchema<{
227
- readonly id: v.StringSchema<undefined>;
228
- readonly type: v.LiteralSchema<"last_visited_time", undefined>;
229
- readonly last_visited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
230
- }, undefined>], undefined>, undefined>, undefined>;
231
- }, undefined>;
232
74
  export type LegacyNotionDataSourcePageBridge = v.InferOutput<typeof legacyNotionDataSourcePageBridgeSchema>;
233
- /** Internal SDK type for a parsed bridge page. */
234
- export type NotionDataSourcePageBridge = v.InferOutput<typeof notionDataSourcePageBridgeSchema>;
@@ -1,6 +1,5 @@
1
1
  import * as v from "valibot";
2
2
  import { notionPageIdSchema } from "../ids.js";
3
- import { notionPagePropertyValueSchema } from "../pages/page.js";
4
3
  import { notionDataSourceValueSchema } from "./dataSourceValue.js";
5
4
  /**
6
5
  * Bridge shape for a data source page, as parsed from inbound host messages. The host keys
@@ -14,9 +13,3 @@ export const legacyNotionDataSourcePageBridgeSchema = v.object({
14
13
  in_trash: v.boolean(),
15
14
  propertiesById: v.record(v.string(), v.optional(notionDataSourceValueSchema)),
16
15
  });
17
- export const notionDataSourcePageBridgeSchema = v.object({
18
- id: notionPageIdSchema,
19
- is_archived: v.boolean(),
20
- in_trash: v.boolean(),
21
- properties: v.record(v.string(), v.optional(notionPagePropertyValueSchema)),
22
- });
@@ -11,10 +11,10 @@ export declare const notionTimeReminderSchema: v.ObjectSchema<{
11
11
  readonly value: v.NumberSchema<undefined>;
12
12
  }, undefined>;
13
13
  export type NotionTimeReminder = v.InferOutput<typeof notionTimeReminderSchema>;
14
- export declare const notionNoReminderSchema: v.ObjectSchema<{
14
+ export declare const notionDisabledReminderSchema: v.ObjectSchema<{
15
15
  readonly unit: v.LiteralSchema<"none", undefined>;
16
16
  }, undefined>;
17
- export type NotionNoReminder = v.InferOutput<typeof notionNoReminderSchema>;
17
+ export type NotionDisabledReminder = v.InferOutput<typeof notionDisabledReminderSchema>;
18
18
  /**
19
19
  * Possible types for a Notion `datetime` reminder.
20
20
  */
@@ -9,7 +9,9 @@ export const notionTimeReminderSchema = v.object({
9
9
  unit: v.picklist(["hour", "minute"]),
10
10
  value: v.number(),
11
11
  });
12
- export const notionNoReminderSchema = v.object({
12
+ // An omitted reminder can inherit the date property's default reminder.
13
+ // "none" explicitly disables reminders instead.
14
+ export const notionDisabledReminderSchema = v.object({
13
15
  unit: v.literal("none"),
14
16
  });
15
17
  /**
@@ -19,25 +21,25 @@ export const notionDateTimeReminderSchema = v.union([
19
21
  notionDateReminderSchema,
20
22
  notionTimeReminderSchema,
21
23
  ]);
22
- const dateOrNoReminder = v.optional(v.union([notionDateReminderSchema, notionNoReminderSchema]));
23
- const dateTimeOrNoReminder = v.optional(v.union([notionDateTimeReminderSchema, notionNoReminderSchema]));
24
+ const dateOrDisabledReminder = v.optional(v.union([notionDateReminderSchema, notionDisabledReminderSchema]));
25
+ const dateTimeOrDisabledReminder = v.optional(v.union([notionDateTimeReminderSchema, notionDisabledReminderSchema]));
24
26
  export const notionDateSchema = v.object({
25
27
  type: v.literal("date"),
26
28
  start_date: v.string(),
27
- reminder: dateOrNoReminder,
29
+ reminder: dateOrDisabledReminder,
28
30
  });
29
31
  export const notionDateRangeSchema = v.object({
30
32
  type: v.literal("daterange"),
31
33
  start_date: v.string(),
32
34
  end_date: v.string(),
33
- reminder: dateOrNoReminder,
35
+ reminder: dateOrDisabledReminder,
34
36
  });
35
37
  export const notionDateTimeSchema = v.object({
36
38
  type: v.literal("datetime"),
37
39
  start_date: v.string(),
38
40
  start_time: v.string(),
39
41
  time_zone: v.optional(v.string()),
40
- reminder: dateTimeOrNoReminder,
42
+ reminder: dateTimeOrDisabledReminder,
41
43
  });
42
44
  export const notionDateTimeRangeSchema = v.object({
43
45
  type: v.literal("datetimerange"),
@@ -46,7 +48,7 @@ export const notionDateTimeRangeSchema = v.object({
46
48
  end_date: v.string(),
47
49
  end_time: v.string(),
48
50
  time_zone: v.optional(v.string()),
49
- reminder: dateTimeOrNoReminder,
51
+ reminder: dateTimeOrDisabledReminder,
50
52
  });
51
53
  /**
52
54
  * Possible types for a Notion `date` value.
@@ -130,11 +130,49 @@ export declare const createPageMessageSchema: v.ObjectSchema<{
130
130
  }, undefined>, v.ObjectSchema<{
131
131
  readonly id: v.StringSchema<undefined>;
132
132
  readonly type: v.LiteralSchema<"date", undefined>;
133
- readonly date: v.NullableSchema<v.ObjectSchema<{
133
+ readonly date: v.NullableSchema<v.UnionSchema<[v.ObjectSchema<{
134
+ readonly end: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
135
+ readonly time_zone: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
136
+ readonly reminder: v.OptionalSchema<v.UnionSchema<[v.UnionSchema<[v.ObjectSchema<{
137
+ readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
138
+ readonly value: v.NumberSchema<undefined>;
139
+ readonly time: v.StringSchema<undefined>;
140
+ readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
141
+ }, undefined>, v.ObjectSchema<{
142
+ readonly unit: v.PicklistSchema<["hour", "minute"], undefined>;
143
+ readonly value: v.NumberSchema<undefined>;
144
+ }, undefined>], undefined>, v.ObjectSchema<{
145
+ readonly unit: v.LiteralSchema<"none", undefined>;
146
+ }, undefined>], undefined>, undefined>;
147
+ readonly start: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "T", undefined>]>;
148
+ }, undefined>, v.ObjectSchema<{
149
+ readonly start: v.StringSchema<undefined>;
150
+ readonly end: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
151
+ readonly reminder: v.OptionalSchema<v.UnionSchema<[v.UnionSchema<[v.ObjectSchema<{
152
+ readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
153
+ readonly value: v.NumberSchema<undefined>;
154
+ readonly time: v.StringSchema<undefined>;
155
+ readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
156
+ }, undefined>, v.ObjectSchema<{
157
+ readonly unit: v.PicklistSchema<["hour", "minute"], undefined>;
158
+ readonly value: v.NumberSchema<undefined>;
159
+ }, undefined>], undefined>, v.ObjectSchema<{
160
+ readonly unit: v.LiteralSchema<"none", undefined>;
161
+ }, undefined>], undefined>, undefined>;
162
+ readonly time_zone: v.StringSchema<undefined>;
163
+ }, undefined>, v.ObjectSchema<{
134
164
  readonly start: v.StringSchema<undefined>;
135
165
  readonly end: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
136
166
  readonly time_zone: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
137
- }, undefined>, undefined>;
167
+ readonly reminder: v.OptionalSchema<v.UnionSchema<[v.ObjectSchema<{
168
+ readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
169
+ readonly value: v.NumberSchema<undefined>;
170
+ readonly time: v.StringSchema<undefined>;
171
+ readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
172
+ }, undefined>, v.ObjectSchema<{
173
+ readonly unit: v.LiteralSchema<"none", undefined>;
174
+ }, undefined>], undefined>, undefined>;
175
+ }, undefined>], undefined>, undefined>;
138
176
  }, undefined>, v.ObjectSchema<{
139
177
  readonly id: v.StringSchema<undefined>;
140
178
  readonly type: v.LiteralSchema<"people", undefined>;
@@ -1,6 +1,6 @@
1
1
  import * as v from "valibot";
2
2
  import { notionBlockIdSchema, notionDataSourceIdSchema, notionPageIdSchema, } from "../ids.js";
3
- import { notionPagePropertyReadMapSchema } from "../pages/page.js";
3
+ import { notionPagePropertyWriteMapSchema } from "../pages/page.js";
4
4
  /**
5
5
  * Describes where the newly created page should be inserted.
6
6
  * - `start` / `end` (default): prepend / append to the request's `parent`
@@ -46,6 +46,6 @@ export const createPageMessageSchema = v.object({
46
46
  * To create a page with manifest-defined property keys, call `pages.create`. The SDK resolves
47
47
  * those keys before it sends this message.
48
48
  */
49
- properties: notionPagePropertyReadMapSchema,
49
+ properties: notionPagePropertyWriteMapSchema,
50
50
  position: v.optional(notionCreatePagePositionSchema),
51
51
  });