@nakanoaas/notion-valibot-schema 0.0.4 → 0.0.5

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 (133) hide show
  1. package/dist/checkbox.cjs +29 -0
  2. package/dist/checkbox.cjs.map +1 -1
  3. package/dist/checkbox.d.cts +30 -0
  4. package/dist/checkbox.d.mts +30 -0
  5. package/dist/checkbox.mjs +29 -0
  6. package/dist/checkbox.mjs.map +1 -1
  7. package/dist/created-by.cjs +75 -0
  8. package/dist/created-by.cjs.map +1 -1
  9. package/dist/created-by.d.cts +76 -0
  10. package/dist/created-by.d.mts +76 -0
  11. package/dist/created-by.mjs +75 -0
  12. package/dist/created-by.mjs.map +1 -1
  13. package/dist/created-time.cjs +27 -0
  14. package/dist/created-time.cjs.map +1 -1
  15. package/dist/created-time.d.cts +28 -0
  16. package/dist/created-time.d.mts +28 -0
  17. package/dist/created-time.mjs +27 -0
  18. package/dist/created-time.mjs.map +1 -1
  19. package/dist/date.cjs +188 -0
  20. package/dist/date.cjs.map +1 -1
  21. package/dist/date.d.cts +189 -0
  22. package/dist/date.d.mts +189 -0
  23. package/dist/date.mjs +188 -0
  24. package/dist/date.mjs.map +1 -1
  25. package/dist/email.cjs +58 -0
  26. package/dist/email.cjs.map +1 -1
  27. package/dist/email.d.cts +59 -0
  28. package/dist/email.d.mts +59 -0
  29. package/dist/email.mjs +58 -0
  30. package/dist/email.mjs.map +1 -1
  31. package/dist/files.cjs +39 -0
  32. package/dist/files.cjs.map +1 -1
  33. package/dist/files.d.cts +40 -0
  34. package/dist/files.d.mts +40 -0
  35. package/dist/files.mjs +39 -0
  36. package/dist/files.mjs.map +1 -1
  37. package/dist/formula.cjs +72 -0
  38. package/dist/formula.cjs.map +1 -1
  39. package/dist/formula.d.cts +73 -0
  40. package/dist/formula.d.mts +73 -0
  41. package/dist/formula.mjs +72 -0
  42. package/dist/formula.mjs.map +1 -1
  43. package/dist/last-edited-by.cjs +68 -0
  44. package/dist/last-edited-by.cjs.map +1 -1
  45. package/dist/last-edited-by.d.cts +69 -0
  46. package/dist/last-edited-by.d.mts +69 -0
  47. package/dist/last-edited-by.mjs +68 -0
  48. package/dist/last-edited-by.mjs.map +1 -1
  49. package/dist/last-edited-time.cjs +27 -0
  50. package/dist/last-edited-time.cjs.map +1 -1
  51. package/dist/last-edited-time.d.cts +28 -0
  52. package/dist/last-edited-time.d.mts +28 -0
  53. package/dist/last-edited-time.mjs +27 -0
  54. package/dist/last-edited-time.mjs.map +1 -1
  55. package/dist/multi-select.cjs +60 -0
  56. package/dist/multi-select.cjs.map +1 -1
  57. package/dist/multi-select.d.cts +61 -0
  58. package/dist/multi-select.d.mts +61 -0
  59. package/dist/multi-select.mjs +60 -0
  60. package/dist/multi-select.mjs.map +1 -1
  61. package/dist/number.cjs +58 -0
  62. package/dist/number.cjs.map +1 -1
  63. package/dist/number.d.cts +59 -0
  64. package/dist/number.d.mts +59 -0
  65. package/dist/number.mjs +58 -0
  66. package/dist/number.mjs.map +1 -1
  67. package/dist/people.cjs +84 -0
  68. package/dist/people.cjs.map +1 -1
  69. package/dist/people.d.cts +85 -0
  70. package/dist/people.d.mts +85 -0
  71. package/dist/people.mjs +84 -0
  72. package/dist/people.mjs.map +1 -1
  73. package/dist/phone-number.cjs +58 -0
  74. package/dist/phone-number.cjs.map +1 -1
  75. package/dist/phone-number.d.cts +59 -0
  76. package/dist/phone-number.d.mts +59 -0
  77. package/dist/phone-number.mjs +58 -0
  78. package/dist/phone-number.mjs.map +1 -1
  79. package/dist/place.cjs +128 -0
  80. package/dist/place.cjs.map +1 -1
  81. package/dist/place.d.cts +85 -0
  82. package/dist/place.d.mts +85 -0
  83. package/dist/place.mjs +128 -0
  84. package/dist/place.mjs.map +1 -1
  85. package/dist/relation.cjs +131 -0
  86. package/dist/relation.cjs.map +1 -1
  87. package/dist/relation.d.cts +94 -0
  88. package/dist/relation.d.mts +94 -0
  89. package/dist/relation.mjs +131 -0
  90. package/dist/relation.mjs.map +1 -1
  91. package/dist/rollup.cjs +200 -0
  92. package/dist/rollup.cjs.map +1 -1
  93. package/dist/rollup.d.cts +201 -0
  94. package/dist/rollup.d.mts +201 -0
  95. package/dist/rollup.mjs +200 -0
  96. package/dist/rollup.mjs.map +1 -1
  97. package/dist/select.cjs +120 -0
  98. package/dist/select.cjs.map +1 -1
  99. package/dist/select.d.cts +121 -0
  100. package/dist/select.d.mts +121 -0
  101. package/dist/select.mjs +120 -0
  102. package/dist/select.mjs.map +1 -1
  103. package/dist/status.cjs +120 -0
  104. package/dist/status.cjs.map +1 -1
  105. package/dist/status.d.cts +121 -0
  106. package/dist/status.d.mts +121 -0
  107. package/dist/status.mjs +120 -0
  108. package/dist/status.mjs.map +1 -1
  109. package/dist/text.cjs +100 -0
  110. package/dist/text.cjs.map +1 -1
  111. package/dist/text.d.cts +63 -0
  112. package/dist/text.d.mts +63 -0
  113. package/dist/text.mjs +100 -0
  114. package/dist/text.mjs.map +1 -1
  115. package/dist/unique-id.cjs +69 -0
  116. package/dist/unique-id.cjs.map +1 -1
  117. package/dist/unique-id.d.cts +70 -0
  118. package/dist/unique-id.d.mts +70 -0
  119. package/dist/unique-id.mjs +69 -0
  120. package/dist/unique-id.mjs.map +1 -1
  121. package/dist/url.cjs +58 -0
  122. package/dist/url.cjs.map +1 -1
  123. package/dist/url.d.cts +59 -0
  124. package/dist/url.d.mts +59 -0
  125. package/dist/url.mjs +58 -0
  126. package/dist/url.mjs.map +1 -1
  127. package/dist/verification.cjs +80 -0
  128. package/dist/verification.cjs.map +1 -1
  129. package/dist/verification.d.cts +81 -0
  130. package/dist/verification.d.mts +81 -0
  131. package/dist/verification.mjs +80 -0
  132. package/dist/verification.mjs.map +1 -1
  133. package/package.json +1 -1
package/dist/rollup.d.mts CHANGED
@@ -1,6 +1,39 @@
1
1
  import * as v from "valibot";
2
2
 
3
3
  //#region src/rollup.d.ts
4
+
5
+ /**
6
+ * Schema to extract the `rollup` property with number type from a Notion page property or `null`.
7
+ *
8
+ * **Input:**
9
+ * ```
10
+ * {
11
+ * rollup: {
12
+ * type: "number";
13
+ * number: number | null;
14
+ * };
15
+ * }
16
+ * ```
17
+ *
18
+ * **Output:** `number | null`
19
+ *
20
+ * @example
21
+ * ```ts
22
+ * import * as v from "valibot";
23
+ * import { NullableRollupNumberSchema } from "@nakanoaas/notion-valibot-utils";
24
+ *
25
+ * const PageSchema = v.object({
26
+ * id: v.string(),
27
+ * properties: v.object({
28
+ * Sum: NullableRollupNumberSchema,
29
+ * }),
30
+ * });
31
+ *
32
+ * const page = await notion.pages.retrieve({ page_id: "..." });
33
+ * const parsed = v.parse(PageSchema, page);
34
+ * // parsed.properties.Sum: number | null
35
+ * ```
36
+ */
4
37
  declare const NullableRollupNumberSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
5
38
  readonly rollup: v.ObjectSchema<{
6
39
  readonly type: v.LiteralSchema<"number", undefined>;
@@ -12,6 +45,38 @@ declare const NullableRollupNumberSchema: v.SchemaWithPipe<readonly [v.ObjectSch
12
45
  number: number | null;
13
46
  };
14
47
  }, number | null>]>;
48
+ /**
49
+ * Schema to extract the `rollup` property with number type from a Notion page property.
50
+ *
51
+ * **Input:**
52
+ * ```
53
+ * {
54
+ * rollup: {
55
+ * type: "number";
56
+ * number: number;
57
+ * };
58
+ * }
59
+ * ```
60
+ *
61
+ * **Output:** `number`
62
+ *
63
+ * @example
64
+ * ```ts
65
+ * import * as v from "valibot";
66
+ * import { RollupNumberSchema } from "@nakanoaas/notion-valibot-utils";
67
+ *
68
+ * const PageSchema = v.object({
69
+ * id: v.string(),
70
+ * properties: v.object({
71
+ * Sum: RollupNumberSchema,
72
+ * }),
73
+ * });
74
+ *
75
+ * const page = await notion.pages.retrieve({ page_id: "..." });
76
+ * const parsed = v.parse(PageSchema, page);
77
+ * // parsed.properties.Sum: number
78
+ * ```
79
+ */
15
80
  declare const RollupNumberSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
16
81
  readonly rollup: v.ObjectSchema<{
17
82
  readonly type: v.LiteralSchema<"number", undefined>;
@@ -23,6 +88,42 @@ declare const RollupNumberSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
23
88
  number: number;
24
89
  };
25
90
  }, number>]>;
91
+ /**
92
+ * Schema to extract the `rollup` property with date type from a Notion page property and transform it to a `Date` object or `null`.
93
+ *
94
+ * **Input:**
95
+ * ```
96
+ * {
97
+ * rollup: {
98
+ * type: "date";
99
+ * date: {
100
+ * start: string;
101
+ * end: string | null;
102
+ * time_zone: string | null;
103
+ * } | null;
104
+ * };
105
+ * }
106
+ * ```
107
+ *
108
+ * **Output:** `Date | null`
109
+ *
110
+ * @example
111
+ * ```ts
112
+ * import * as v from "valibot";
113
+ * import { NullableRollupDateSchema } from "@nakanoaas/notion-valibot-utils";
114
+ *
115
+ * const PageSchema = v.object({
116
+ * id: v.string(),
117
+ * properties: v.object({
118
+ * LatestDate: NullableRollupDateSchema,
119
+ * }),
120
+ * });
121
+ *
122
+ * const page = await notion.pages.retrieve({ page_id: "..." });
123
+ * const parsed = v.parse(PageSchema, page);
124
+ * // parsed.properties.LatestDate: Date | null
125
+ * ```
126
+ */
26
127
  declare const NullableRollupDateSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
27
128
  readonly rollup: v.ObjectSchema<{
28
129
  readonly type: v.LiteralSchema<"date", undefined>;
@@ -42,6 +143,42 @@ declare const NullableRollupDateSchema: v.SchemaWithPipe<readonly [v.ObjectSchem
42
143
  } | null;
43
144
  };
44
145
  }, Date | null>]>;
146
+ /**
147
+ * Schema to extract the `rollup` property with date type from a Notion page property and transform it to a `Date` object.
148
+ *
149
+ * **Input:**
150
+ * ```
151
+ * {
152
+ * rollup: {
153
+ * type: "date";
154
+ * date: {
155
+ * start: string;
156
+ * end: string | null;
157
+ * time_zone: string | null;
158
+ * };
159
+ * };
160
+ * }
161
+ * ```
162
+ *
163
+ * **Output:** `Date`
164
+ *
165
+ * @example
166
+ * ```ts
167
+ * import * as v from "valibot";
168
+ * import { RollupDateSchema } from "@nakanoaas/notion-valibot-utils";
169
+ *
170
+ * const PageSchema = v.object({
171
+ * id: v.string(),
172
+ * properties: v.object({
173
+ * LatestDate: RollupDateSchema,
174
+ * }),
175
+ * });
176
+ *
177
+ * const page = await notion.pages.retrieve({ page_id: "..." });
178
+ * const parsed = v.parse(PageSchema, page);
179
+ * // parsed.properties.LatestDate: Date
180
+ * ```
181
+ */
45
182
  declare const RollupDateSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
46
183
  readonly rollup: v.ObjectSchema<{
47
184
  readonly type: v.LiteralSchema<"date", undefined>;
@@ -61,6 +198,70 @@ declare const RollupDateSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
61
198
  };
62
199
  };
63
200
  }, Date>]>;
201
+ /**
202
+ * Schema factory to extract the `rollup` property with array type from a Notion page property.
203
+ *
204
+ * This is a generic schema factory that accepts another schema as a parameter,
205
+ * allowing you to combine it with other schemas in this library to extract
206
+ * typed rollup array results. The rollup property in Notion can return an
207
+ * array of different types of values depending on the rollup configuration.
208
+ *
209
+ * **Input:**
210
+ * ```
211
+ * {
212
+ * rollup: {
213
+ * type: "array";
214
+ * array: Array<{ type: string; ... }>;
215
+ * };
216
+ * }
217
+ * ```
218
+ *
219
+ * **Output:** The output type depends on the schema passed as a parameter.
220
+ * For example, if a schema for number properties is passed, the output will be `Array<number>`.
221
+ *
222
+ * @param schema - A schema that validates each element in the rollup array.
223
+ * Must accept an object with a `type` field.
224
+ *
225
+ * @example
226
+ * ```ts
227
+ * import * as v from "valibot";
228
+ * import { RollupArraySchema, NumberSchema } from "@nakanoaas/notion-valibot-utils";
229
+ *
230
+ * const PageSchema = v.object({
231
+ * id: v.string(),
232
+ * properties: v.object({
233
+ * RollupNumbers: RollupArraySchema(NumberSchema),
234
+ * }),
235
+ * });
236
+ *
237
+ * const page = await notion.pages.retrieve({ page_id: "..." });
238
+ * const parsed = v.parse(PageSchema, page);
239
+ * // parsed.properties.RollupNumbers: number[]
240
+ * ```
241
+ *
242
+ * @example
243
+ * ```ts
244
+ * import * as v from "valibot";
245
+ * import { RollupArraySchema } from "@nakanoaas/notion-valibot-utils";
246
+ *
247
+ * // Custom schema for relation rollup
248
+ * const RelationItemSchema = v.object({
249
+ * type: v.literal("relation"),
250
+ * relation: v.array(v.object({ id: v.string() })),
251
+ * });
252
+ *
253
+ * const PageSchema = v.object({
254
+ * id: v.string(),
255
+ * properties: v.object({
256
+ * RollupRelations: RollupArraySchema(RelationItemSchema),
257
+ * }),
258
+ * });
259
+ *
260
+ * const page = await notion.pages.retrieve({ page_id: "..." });
261
+ * const parsed = v.parse(PageSchema, page);
262
+ * // parsed.properties.RollupRelations: Array<{ type: "relation"; relation: Array<{ id: string }> }>
263
+ * ```
264
+ */
64
265
  declare function RollupArraySchema<S extends v.GenericSchema<{
65
266
  type: string;
66
267
  }, unknown>>(schema: S): v.SchemaWithPipe<readonly [v.ObjectSchema<{
package/dist/rollup.mjs CHANGED
@@ -2,22 +2,222 @@ import { DateObjectSchema } from "./date.mjs";
2
2
  import * as v from "valibot";
3
3
 
4
4
  //#region src/rollup.ts
5
+ /**
6
+ * Schema to extract the `rollup` property with number type from a Notion page property or `null`.
7
+ *
8
+ * **Input:**
9
+ * ```
10
+ * {
11
+ * rollup: {
12
+ * type: "number";
13
+ * number: number | null;
14
+ * };
15
+ * }
16
+ * ```
17
+ *
18
+ * **Output:** `number | null`
19
+ *
20
+ * @example
21
+ * ```ts
22
+ * import * as v from "valibot";
23
+ * import { NullableRollupNumberSchema } from "@nakanoaas/notion-valibot-utils";
24
+ *
25
+ * const PageSchema = v.object({
26
+ * id: v.string(),
27
+ * properties: v.object({
28
+ * Sum: NullableRollupNumberSchema,
29
+ * }),
30
+ * });
31
+ *
32
+ * const page = await notion.pages.retrieve({ page_id: "..." });
33
+ * const parsed = v.parse(PageSchema, page);
34
+ * // parsed.properties.Sum: number | null
35
+ * ```
36
+ */
5
37
  const NullableRollupNumberSchema = v.pipe(v.object({ rollup: v.object({
6
38
  type: v.literal("number"),
7
39
  number: v.nullable(v.number())
8
40
  }) }), v.transform((v$1) => v$1.rollup.number));
41
+ /**
42
+ * Schema to extract the `rollup` property with number type from a Notion page property.
43
+ *
44
+ * **Input:**
45
+ * ```
46
+ * {
47
+ * rollup: {
48
+ * type: "number";
49
+ * number: number;
50
+ * };
51
+ * }
52
+ * ```
53
+ *
54
+ * **Output:** `number`
55
+ *
56
+ * @example
57
+ * ```ts
58
+ * import * as v from "valibot";
59
+ * import { RollupNumberSchema } from "@nakanoaas/notion-valibot-utils";
60
+ *
61
+ * const PageSchema = v.object({
62
+ * id: v.string(),
63
+ * properties: v.object({
64
+ * Sum: RollupNumberSchema,
65
+ * }),
66
+ * });
67
+ *
68
+ * const page = await notion.pages.retrieve({ page_id: "..." });
69
+ * const parsed = v.parse(PageSchema, page);
70
+ * // parsed.properties.Sum: number
71
+ * ```
72
+ */
9
73
  const RollupNumberSchema = v.pipe(v.object({ rollup: v.object({
10
74
  type: v.literal("number"),
11
75
  number: v.number()
12
76
  }) }), v.transform((v$1) => v$1.rollup.number));
77
+ /**
78
+ * Schema to extract the `rollup` property with date type from a Notion page property and transform it to a `Date` object or `null`.
79
+ *
80
+ * **Input:**
81
+ * ```
82
+ * {
83
+ * rollup: {
84
+ * type: "date";
85
+ * date: {
86
+ * start: string;
87
+ * end: string | null;
88
+ * time_zone: string | null;
89
+ * } | null;
90
+ * };
91
+ * }
92
+ * ```
93
+ *
94
+ * **Output:** `Date | null`
95
+ *
96
+ * @example
97
+ * ```ts
98
+ * import * as v from "valibot";
99
+ * import { NullableRollupDateSchema } from "@nakanoaas/notion-valibot-utils";
100
+ *
101
+ * const PageSchema = v.object({
102
+ * id: v.string(),
103
+ * properties: v.object({
104
+ * LatestDate: NullableRollupDateSchema,
105
+ * }),
106
+ * });
107
+ *
108
+ * const page = await notion.pages.retrieve({ page_id: "..." });
109
+ * const parsed = v.parse(PageSchema, page);
110
+ * // parsed.properties.LatestDate: Date | null
111
+ * ```
112
+ */
13
113
  const NullableRollupDateSchema = v.pipe(v.object({ rollup: v.object({
14
114
  type: v.literal("date"),
15
115
  date: v.nullable(DateObjectSchema)
16
116
  }) }), v.transform((v$1) => v$1.rollup.date ? new Date(v$1.rollup.date.start) : null));
117
+ /**
118
+ * Schema to extract the `rollup` property with date type from a Notion page property and transform it to a `Date` object.
119
+ *
120
+ * **Input:**
121
+ * ```
122
+ * {
123
+ * rollup: {
124
+ * type: "date";
125
+ * date: {
126
+ * start: string;
127
+ * end: string | null;
128
+ * time_zone: string | null;
129
+ * };
130
+ * };
131
+ * }
132
+ * ```
133
+ *
134
+ * **Output:** `Date`
135
+ *
136
+ * @example
137
+ * ```ts
138
+ * import * as v from "valibot";
139
+ * import { RollupDateSchema } from "@nakanoaas/notion-valibot-utils";
140
+ *
141
+ * const PageSchema = v.object({
142
+ * id: v.string(),
143
+ * properties: v.object({
144
+ * LatestDate: RollupDateSchema,
145
+ * }),
146
+ * });
147
+ *
148
+ * const page = await notion.pages.retrieve({ page_id: "..." });
149
+ * const parsed = v.parse(PageSchema, page);
150
+ * // parsed.properties.LatestDate: Date
151
+ * ```
152
+ */
17
153
  const RollupDateSchema = v.pipe(v.object({ rollup: v.object({
18
154
  type: v.literal("date"),
19
155
  date: DateObjectSchema
20
156
  }) }), v.transform((v$1) => new Date(v$1.rollup.date.start)));
157
+ /**
158
+ * Schema factory to extract the `rollup` property with array type from a Notion page property.
159
+ *
160
+ * This is a generic schema factory that accepts another schema as a parameter,
161
+ * allowing you to combine it with other schemas in this library to extract
162
+ * typed rollup array results. The rollup property in Notion can return an
163
+ * array of different types of values depending on the rollup configuration.
164
+ *
165
+ * **Input:**
166
+ * ```
167
+ * {
168
+ * rollup: {
169
+ * type: "array";
170
+ * array: Array<{ type: string; ... }>;
171
+ * };
172
+ * }
173
+ * ```
174
+ *
175
+ * **Output:** The output type depends on the schema passed as a parameter.
176
+ * For example, if a schema for number properties is passed, the output will be `Array<number>`.
177
+ *
178
+ * @param schema - A schema that validates each element in the rollup array.
179
+ * Must accept an object with a `type` field.
180
+ *
181
+ * @example
182
+ * ```ts
183
+ * import * as v from "valibot";
184
+ * import { RollupArraySchema, NumberSchema } from "@nakanoaas/notion-valibot-utils";
185
+ *
186
+ * const PageSchema = v.object({
187
+ * id: v.string(),
188
+ * properties: v.object({
189
+ * RollupNumbers: RollupArraySchema(NumberSchema),
190
+ * }),
191
+ * });
192
+ *
193
+ * const page = await notion.pages.retrieve({ page_id: "..." });
194
+ * const parsed = v.parse(PageSchema, page);
195
+ * // parsed.properties.RollupNumbers: number[]
196
+ * ```
197
+ *
198
+ * @example
199
+ * ```ts
200
+ * import * as v from "valibot";
201
+ * import { RollupArraySchema } from "@nakanoaas/notion-valibot-utils";
202
+ *
203
+ * // Custom schema for relation rollup
204
+ * const RelationItemSchema = v.object({
205
+ * type: v.literal("relation"),
206
+ * relation: v.array(v.object({ id: v.string() })),
207
+ * });
208
+ *
209
+ * const PageSchema = v.object({
210
+ * id: v.string(),
211
+ * properties: v.object({
212
+ * RollupRelations: RollupArraySchema(RelationItemSchema),
213
+ * }),
214
+ * });
215
+ *
216
+ * const page = await notion.pages.retrieve({ page_id: "..." });
217
+ * const parsed = v.parse(PageSchema, page);
218
+ * // parsed.properties.RollupRelations: Array<{ type: "relation"; relation: Array<{ id: string }> }>
219
+ * ```
220
+ */
21
221
  function RollupArraySchema(schema) {
22
222
  return v.pipe(v.object({ rollup: v.object({
23
223
  type: v.literal("array"),
@@ -1 +1 @@
1
- {"version":3,"file":"rollup.mjs","names":["v"],"sources":["../src/rollup.ts"],"sourcesContent":["import * as v from \"valibot\";\n\nimport { DateObjectSchema } from \"./date\";\n\nexport const NullableRollupNumberSchema = v.pipe(\n\tv.object({\n\t\trollup: v.object({\n\t\t\ttype: v.literal(\"number\"),\n\t\t\tnumber: v.nullable(v.number()),\n\t\t}),\n\t}),\n\tv.transform((v) => v.rollup.number),\n);\n\nexport const RollupNumberSchema = v.pipe(\n\tv.object({\n\t\trollup: v.object({\n\t\t\ttype: v.literal(\"number\"),\n\t\t\tnumber: v.number(),\n\t\t}),\n\t}),\n\tv.transform((v) => v.rollup.number),\n);\n\nexport const NullableRollupDateSchema = v.pipe(\n\tv.object({\n\t\trollup: v.object({\n\t\t\ttype: v.literal(\"date\"),\n\t\t\tdate: v.nullable(DateObjectSchema),\n\t\t}),\n\t}),\n\tv.transform((v) => (v.rollup.date ? new Date(v.rollup.date.start) : null)),\n);\n\nexport const RollupDateSchema = v.pipe(\n\tv.object({\n\t\trollup: v.object({\n\t\t\ttype: v.literal(\"date\"),\n\t\t\tdate: DateObjectSchema,\n\t\t}),\n\t}),\n\tv.transform((v) => new Date(v.rollup.date.start)),\n);\n\nexport function RollupArraySchema<\n\tS extends v.GenericSchema<{ type: string }, unknown>,\n>(schema: S) {\n\treturn v.pipe(\n\t\tv.object({\n\t\t\trollup: v.object({\n\t\t\t\ttype: v.literal(\"array\"),\n\t\t\t\tarray: v.array(schema),\n\t\t\t}),\n\t\t}),\n\t\tv.transform((v) => v.rollup.array),\n\t);\n}\n"],"mappings":";;;;AAIA,MAAa,6BAA6B,EAAE,KAC3C,EAAE,OAAO,EACR,QAAQ,EAAE,OAAO;CAChB,MAAM,EAAE,QAAQ,SAAS;CACzB,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAC;CAC9B,CAAC,EACF,CAAC,EACF,EAAE,WAAW,QAAMA,IAAE,OAAO,OAAO,CACnC;AAED,MAAa,qBAAqB,EAAE,KACnC,EAAE,OAAO,EACR,QAAQ,EAAE,OAAO;CAChB,MAAM,EAAE,QAAQ,SAAS;CACzB,QAAQ,EAAE,QAAQ;CAClB,CAAC,EACF,CAAC,EACF,EAAE,WAAW,QAAMA,IAAE,OAAO,OAAO,CACnC;AAED,MAAa,2BAA2B,EAAE,KACzC,EAAE,OAAO,EACR,QAAQ,EAAE,OAAO;CAChB,MAAM,EAAE,QAAQ,OAAO;CACvB,MAAM,EAAE,SAAS,iBAAiB;CAClC,CAAC,EACF,CAAC,EACF,EAAE,WAAW,QAAOA,IAAE,OAAO,OAAO,IAAI,KAAKA,IAAE,OAAO,KAAK,MAAM,GAAG,KAAM,CAC1E;AAED,MAAa,mBAAmB,EAAE,KACjC,EAAE,OAAO,EACR,QAAQ,EAAE,OAAO;CAChB,MAAM,EAAE,QAAQ,OAAO;CACvB,MAAM;CACN,CAAC,EACF,CAAC,EACF,EAAE,WAAW,QAAM,IAAI,KAAKA,IAAE,OAAO,KAAK,MAAM,CAAC,CACjD;AAED,SAAgB,kBAEd,QAAW;AACZ,QAAO,EAAE,KACR,EAAE,OAAO,EACR,QAAQ,EAAE,OAAO;EAChB,MAAM,EAAE,QAAQ,QAAQ;EACxB,OAAO,EAAE,MAAM,OAAO;EACtB,CAAC,EACF,CAAC,EACF,EAAE,WAAW,QAAMA,IAAE,OAAO,MAAM,CAClC"}
1
+ {"version":3,"file":"rollup.mjs","names":["v"],"sources":["../src/rollup.ts"],"sourcesContent":["import * as v from \"valibot\";\n\nimport { DateObjectSchema } from \"./date\";\n\n/**\n * Schema to extract the `rollup` property with number type from a Notion page property or `null`.\n *\n * **Input:**\n * ```\n * {\n * rollup: {\n * type: \"number\";\n * number: number | null;\n * };\n * }\n * ```\n *\n * **Output:** `number | null`\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { NullableRollupNumberSchema } from \"@nakanoaas/notion-valibot-utils\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * Sum: NullableRollupNumberSchema,\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.Sum: number | null\n * ```\n */\nexport const NullableRollupNumberSchema = v.pipe(\n\tv.object({\n\t\trollup: v.object({\n\t\t\ttype: v.literal(\"number\"),\n\t\t\tnumber: v.nullable(v.number()),\n\t\t}),\n\t}),\n\tv.transform((v) => v.rollup.number),\n);\n\n/**\n * Schema to extract the `rollup` property with number type from a Notion page property.\n *\n * **Input:**\n * ```\n * {\n * rollup: {\n * type: \"number\";\n * number: number;\n * };\n * }\n * ```\n *\n * **Output:** `number`\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { RollupNumberSchema } from \"@nakanoaas/notion-valibot-utils\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * Sum: RollupNumberSchema,\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.Sum: number\n * ```\n */\nexport const RollupNumberSchema = v.pipe(\n\tv.object({\n\t\trollup: v.object({\n\t\t\ttype: v.literal(\"number\"),\n\t\t\tnumber: v.number(),\n\t\t}),\n\t}),\n\tv.transform((v) => v.rollup.number),\n);\n\n/**\n * Schema to extract the `rollup` property with date type from a Notion page property and transform it to a `Date` object or `null`.\n *\n * **Input:**\n * ```\n * {\n * rollup: {\n * type: \"date\";\n * date: {\n * start: string;\n * end: string | null;\n * time_zone: string | null;\n * } | null;\n * };\n * }\n * ```\n *\n * **Output:** `Date | null`\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { NullableRollupDateSchema } from \"@nakanoaas/notion-valibot-utils\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * LatestDate: NullableRollupDateSchema,\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.LatestDate: Date | null\n * ```\n */\nexport const NullableRollupDateSchema = v.pipe(\n\tv.object({\n\t\trollup: v.object({\n\t\t\ttype: v.literal(\"date\"),\n\t\t\tdate: v.nullable(DateObjectSchema),\n\t\t}),\n\t}),\n\tv.transform((v) => (v.rollup.date ? new Date(v.rollup.date.start) : null)),\n);\n\n/**\n * Schema to extract the `rollup` property with date type from a Notion page property and transform it to a `Date` object.\n *\n * **Input:**\n * ```\n * {\n * rollup: {\n * type: \"date\";\n * date: {\n * start: string;\n * end: string | null;\n * time_zone: string | null;\n * };\n * };\n * }\n * ```\n *\n * **Output:** `Date`\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { RollupDateSchema } from \"@nakanoaas/notion-valibot-utils\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * LatestDate: RollupDateSchema,\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.LatestDate: Date\n * ```\n */\nexport const RollupDateSchema = v.pipe(\n\tv.object({\n\t\trollup: v.object({\n\t\t\ttype: v.literal(\"date\"),\n\t\t\tdate: DateObjectSchema,\n\t\t}),\n\t}),\n\tv.transform((v) => new Date(v.rollup.date.start)),\n);\n\n/**\n * Schema factory to extract the `rollup` property with array type from a Notion page property.\n *\n * This is a generic schema factory that accepts another schema as a parameter,\n * allowing you to combine it with other schemas in this library to extract\n * typed rollup array results. The rollup property in Notion can return an\n * array of different types of values depending on the rollup configuration.\n *\n * **Input:**\n * ```\n * {\n * rollup: {\n * type: \"array\";\n * array: Array<{ type: string; ... }>;\n * };\n * }\n * ```\n *\n * **Output:** The output type depends on the schema passed as a parameter.\n * For example, if a schema for number properties is passed, the output will be `Array<number>`.\n *\n * @param schema - A schema that validates each element in the rollup array.\n * Must accept an object with a `type` field.\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { RollupArraySchema, NumberSchema } from \"@nakanoaas/notion-valibot-utils\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * RollupNumbers: RollupArraySchema(NumberSchema),\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.RollupNumbers: number[]\n * ```\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { RollupArraySchema } from \"@nakanoaas/notion-valibot-utils\";\n *\n * // Custom schema for relation rollup\n * const RelationItemSchema = v.object({\n * type: v.literal(\"relation\"),\n * relation: v.array(v.object({ id: v.string() })),\n * });\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * RollupRelations: RollupArraySchema(RelationItemSchema),\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.RollupRelations: Array<{ type: \"relation\"; relation: Array<{ id: string }> }>\n * ```\n */\nexport function RollupArraySchema<\n\tS extends v.GenericSchema<{ type: string }, unknown>,\n>(schema: S) {\n\treturn v.pipe(\n\t\tv.object({\n\t\t\trollup: v.object({\n\t\t\t\ttype: v.literal(\"array\"),\n\t\t\t\tarray: v.array(schema),\n\t\t\t}),\n\t\t}),\n\t\tv.transform((v) => v.rollup.array),\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,MAAa,6BAA6B,EAAE,KAC3C,EAAE,OAAO,EACR,QAAQ,EAAE,OAAO;CAChB,MAAM,EAAE,QAAQ,SAAS;CACzB,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAC;CAC9B,CAAC,EACF,CAAC,EACF,EAAE,WAAW,QAAMA,IAAE,OAAO,OAAO,CACnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCD,MAAa,qBAAqB,EAAE,KACnC,EAAE,OAAO,EACR,QAAQ,EAAE,OAAO;CAChB,MAAM,EAAE,QAAQ,SAAS;CACzB,QAAQ,EAAE,QAAQ;CAClB,CAAC,EACF,CAAC,EACF,EAAE,WAAW,QAAMA,IAAE,OAAO,OAAO,CACnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCD,MAAa,2BAA2B,EAAE,KACzC,EAAE,OAAO,EACR,QAAQ,EAAE,OAAO;CAChB,MAAM,EAAE,QAAQ,OAAO;CACvB,MAAM,EAAE,SAAS,iBAAiB;CAClC,CAAC,EACF,CAAC,EACF,EAAE,WAAW,QAAOA,IAAE,OAAO,OAAO,IAAI,KAAKA,IAAE,OAAO,KAAK,MAAM,GAAG,KAAM,CAC1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCD,MAAa,mBAAmB,EAAE,KACjC,EAAE,OAAO,EACR,QAAQ,EAAE,OAAO;CAChB,MAAM,EAAE,QAAQ,OAAO;CACvB,MAAM;CACN,CAAC,EACF,CAAC,EACF,EAAE,WAAW,QAAM,IAAI,KAAKA,IAAE,OAAO,KAAK,MAAM,CAAC,CACjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkED,SAAgB,kBAEd,QAAW;AACZ,QAAO,EAAE,KACR,EAAE,OAAO,EACR,QAAQ,EAAE,OAAO;EAChB,MAAM,EAAE,QAAQ,QAAQ;EACxB,OAAO,EAAE,MAAM,OAAO;EACtB,CAAC,EACF,CAAC,EACF,EAAE,WAAW,QAAMA,IAAE,OAAO,MAAM,CAClC"}
package/dist/select.cjs CHANGED
@@ -3,9 +3,129 @@ let valibot = require("valibot");
3
3
  valibot = require_rolldown_runtime.__toESM(valibot);
4
4
 
5
5
  //#region src/select.ts
6
+ /**
7
+ * Schema factory to extract the `select` property from a Notion page property.
8
+ *
9
+ * This is a generic schema factory that accepts another schema as a parameter,
10
+ * allowing you to combine it with other schemas in this library to extract
11
+ * typed select values. The select property in Notion contains an object with
12
+ * a `name` field that can be validated using the provided schema.
13
+ *
14
+ * **Input:**
15
+ * ```
16
+ * {
17
+ * select: {
18
+ * name: string;
19
+ * };
20
+ * }
21
+ * ```
22
+ *
23
+ * **Output:** The output type depends on the schema passed as a parameter.
24
+ * For example, if `v.string()` is passed, the output will be `string`.
25
+ *
26
+ * @param schema - A schema that validates the select option name.
27
+ * Must accept a string value.
28
+ *
29
+ * @example
30
+ * ```ts
31
+ * import * as v from "valibot";
32
+ * import { SelectSchema } from "@nakanoaas/notion-valibot-utils";
33
+ *
34
+ * const PageSchema = v.object({
35
+ * id: v.string(),
36
+ * properties: v.object({
37
+ * Status: SelectSchema(v.string()),
38
+ * }),
39
+ * });
40
+ *
41
+ * const page = await notion.pages.retrieve({ page_id: "..." });
42
+ * const parsed = v.parse(PageSchema, page);
43
+ * // parsed.properties.Status: string
44
+ * ```
45
+ *
46
+ * @example
47
+ * ```ts
48
+ * import * as v from "valibot";
49
+ * import { SelectSchema } from "@nakanoaas/notion-valibot-utils";
50
+ *
51
+ * // Custom schema for enum values
52
+ * const StatusSchema = v.picklist(["todo", "in-progress", "done"]);
53
+ *
54
+ * const PageSchema = v.object({
55
+ * id: v.string(),
56
+ * properties: v.object({
57
+ * Status: SelectSchema(StatusSchema),
58
+ * }),
59
+ * });
60
+ *
61
+ * const page = await notion.pages.retrieve({ page_id: "..." });
62
+ * const parsed = v.parse(PageSchema, page);
63
+ * // parsed.properties.Status: "todo" | "in-progress" | "done"
64
+ * ```
65
+ */
6
66
  function SelectSchema(schema) {
7
67
  return valibot.pipe(valibot.object({ select: valibot.object({ name: schema }) }), valibot.transform((v) => v.select.name));
8
68
  }
69
+ /**
70
+ * Schema factory to extract the `select` property from a Notion page property or `null`.
71
+ *
72
+ * This is a generic schema factory that accepts another schema as a parameter,
73
+ * allowing you to combine it with other schemas in this library to extract
74
+ * typed select values. The select property in Notion contains an object with
75
+ * a `name` field that can be validated using the provided schema, or `null` if not set.
76
+ *
77
+ * **Input:**
78
+ * ```
79
+ * {
80
+ * select: {
81
+ * name: string;
82
+ * } | null;
83
+ * }
84
+ * ```
85
+ *
86
+ * **Output:** The output type depends on the schema passed as a parameter, or `null`.
87
+ * For example, if `v.string()` is passed, the output will be `string | null`.
88
+ *
89
+ * @param schema - A schema that validates the select option name.
90
+ * Must accept a string value.
91
+ *
92
+ * @example
93
+ * ```ts
94
+ * import * as v from "valibot";
95
+ * import { NullableSelectSchema } from "@nakanoaas/notion-valibot-utils";
96
+ *
97
+ * const PageSchema = v.object({
98
+ * id: v.string(),
99
+ * properties: v.object({
100
+ * Status: NullableSelectSchema(v.string()),
101
+ * }),
102
+ * });
103
+ *
104
+ * const page = await notion.pages.retrieve({ page_id: "..." });
105
+ * const parsed = v.parse(PageSchema, page);
106
+ * // parsed.properties.Status: string | null
107
+ * ```
108
+ *
109
+ * @example
110
+ * ```ts
111
+ * import * as v from "valibot";
112
+ * import { NullableSelectSchema } from "@nakanoaas/notion-valibot-utils";
113
+ *
114
+ * // Custom schema for enum values
115
+ * const StatusSchema = v.picklist(["todo", "in-progress", "done"]);
116
+ *
117
+ * const PageSchema = v.object({
118
+ * id: v.string(),
119
+ * properties: v.object({
120
+ * Status: NullableSelectSchema(StatusSchema),
121
+ * }),
122
+ * });
123
+ *
124
+ * const page = await notion.pages.retrieve({ page_id: "..." });
125
+ * const parsed = v.parse(PageSchema, page);
126
+ * // parsed.properties.Status: "todo" | "in-progress" | "done" | null
127
+ * ```
128
+ */
9
129
  function NullableSelectSchema(schema) {
10
130
  return valibot.pipe(valibot.object({ select: valibot.nullable(valibot.object({ name: schema })) }), valibot.transform((v) => v.select?.name ?? null));
11
131
  }
@@ -1 +1 @@
1
- {"version":3,"file":"select.cjs","names":["v"],"sources":["../src/select.ts"],"sourcesContent":["import * as v from \"valibot\";\n\nexport function SelectSchema<T extends v.GenericSchema<string>>(schema: T) {\n\treturn v.pipe(\n\t\tv.object({\n\t\t\tselect: v.object({\n\t\t\t\tname: schema,\n\t\t\t}),\n\t\t}),\n\t\t// biome-ignore lint/style/noNonNullAssertion: valibot inference is not working correctly\n\t\tv.transform((v) => v.select.name!),\n\t);\n}\n\nexport function NullableSelectSchema<T extends v.GenericSchema<string>>(\n\tschema: T,\n) {\n\treturn v.pipe(\n\t\tv.object({\n\t\t\tselect: v.nullable(\n\t\t\t\tv.object({\n\t\t\t\t\tname: schema,\n\t\t\t\t}),\n\t\t\t),\n\t\t}),\n\t\tv.transform((v) => v.select?.name ?? null),\n\t);\n}\n"],"mappings":";;;;;AAEA,SAAgB,aAAgD,QAAW;AAC1E,QAAOA,QAAE,KACRA,QAAE,OAAO,EACR,QAAQA,QAAE,OAAO,EAChB,MAAM,QACN,CAAC,EACF,CAAC,EAEFA,QAAE,WAAW,MAAM,EAAE,OAAO,KAAM,CAClC;;AAGF,SAAgB,qBACf,QACC;AACD,QAAOA,QAAE,KACRA,QAAE,OAAO,EACR,QAAQA,QAAE,SACTA,QAAE,OAAO,EACR,MAAM,QACN,CAAC,CACF,EACD,CAAC,EACFA,QAAE,WAAW,MAAM,EAAE,QAAQ,QAAQ,KAAK,CAC1C"}
1
+ {"version":3,"file":"select.cjs","names":["v"],"sources":["../src/select.ts"],"sourcesContent":["import * as v from \"valibot\";\n\n/**\n * Schema factory to extract the `select` property from a Notion page property.\n *\n * This is a generic schema factory that accepts another schema as a parameter,\n * allowing you to combine it with other schemas in this library to extract\n * typed select values. The select property in Notion contains an object with\n * a `name` field that can be validated using the provided schema.\n *\n * **Input:**\n * ```\n * {\n * select: {\n * name: string;\n * };\n * }\n * ```\n *\n * **Output:** The output type depends on the schema passed as a parameter.\n * For example, if `v.string()` is passed, the output will be `string`.\n *\n * @param schema - A schema that validates the select option name.\n * Must accept a string value.\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { SelectSchema } from \"@nakanoaas/notion-valibot-utils\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * Status: SelectSchema(v.string()),\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.Status: string\n * ```\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { SelectSchema } from \"@nakanoaas/notion-valibot-utils\";\n *\n * // Custom schema for enum values\n * const StatusSchema = v.picklist([\"todo\", \"in-progress\", \"done\"]);\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * Status: SelectSchema(StatusSchema),\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.Status: \"todo\" | \"in-progress\" | \"done\"\n * ```\n */\nexport function SelectSchema<T extends v.GenericSchema<string>>(schema: T) {\n\treturn v.pipe(\n\t\tv.object({\n\t\t\tselect: v.object({\n\t\t\t\tname: schema,\n\t\t\t}),\n\t\t}),\n\t\t// biome-ignore lint/style/noNonNullAssertion: valibot inference is not working correctly\n\t\tv.transform((v) => v.select.name!),\n\t);\n}\n\n/**\n * Schema factory to extract the `select` property from a Notion page property or `null`.\n *\n * This is a generic schema factory that accepts another schema as a parameter,\n * allowing you to combine it with other schemas in this library to extract\n * typed select values. The select property in Notion contains an object with\n * a `name` field that can be validated using the provided schema, or `null` if not set.\n *\n * **Input:**\n * ```\n * {\n * select: {\n * name: string;\n * } | null;\n * }\n * ```\n *\n * **Output:** The output type depends on the schema passed as a parameter, or `null`.\n * For example, if `v.string()` is passed, the output will be `string | null`.\n *\n * @param schema - A schema that validates the select option name.\n * Must accept a string value.\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { NullableSelectSchema } from \"@nakanoaas/notion-valibot-utils\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * Status: NullableSelectSchema(v.string()),\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.Status: string | null\n * ```\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { NullableSelectSchema } from \"@nakanoaas/notion-valibot-utils\";\n *\n * // Custom schema for enum values\n * const StatusSchema = v.picklist([\"todo\", \"in-progress\", \"done\"]);\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * Status: NullableSelectSchema(StatusSchema),\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.Status: \"todo\" | \"in-progress\" | \"done\" | null\n * ```\n */\nexport function NullableSelectSchema<T extends v.GenericSchema<string>>(\n\tschema: T,\n) {\n\treturn v.pipe(\n\t\tv.object({\n\t\t\tselect: v.nullable(\n\t\t\t\tv.object({\n\t\t\t\t\tname: schema,\n\t\t\t\t}),\n\t\t\t),\n\t\t}),\n\t\tv.transform((v) => v.select?.name ?? null),\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8DA,SAAgB,aAAgD,QAAW;AAC1E,QAAOA,QAAE,KACRA,QAAE,OAAO,EACR,QAAQA,QAAE,OAAO,EAChB,MAAM,QACN,CAAC,EACF,CAAC,EAEFA,QAAE,WAAW,MAAM,EAAE,OAAO,KAAM,CAClC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+DF,SAAgB,qBACf,QACC;AACD,QAAOA,QAAE,KACRA,QAAE,OAAO,EACR,QAAQA,QAAE,SACTA,QAAE,OAAO,EACR,MAAM,QACN,CAAC,CACF,EACD,CAAC,EACFA,QAAE,WAAW,MAAM,EAAE,QAAQ,QAAQ,KAAK,CAC1C"}