@nakanoaas/notion-valibot-schema 0.3.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/README.md +95 -14
  2. package/dist/created-by.cjs +30 -26
  3. package/dist/created-by.cjs.map +1 -1
  4. package/dist/created-by.d.cts +35 -48
  5. package/dist/created-by.d.mts +35 -48
  6. package/dist/created-by.mjs +31 -27
  7. package/dist/created-by.mjs.map +1 -1
  8. package/dist/{file.cjs → files.cjs} +6 -6
  9. package/dist/files.cjs.map +1 -0
  10. package/dist/{file.d.cts → files.d.cts} +6 -6
  11. package/dist/{file.d.mts → files.d.mts} +6 -6
  12. package/dist/{file.mjs → files.mjs} +6 -6
  13. package/dist/files.mjs.map +1 -0
  14. package/dist/formula.cjs +120 -19
  15. package/dist/formula.cjs.map +1 -1
  16. package/dist/formula.d.cts +150 -41
  17. package/dist/formula.d.mts +150 -41
  18. package/dist/formula.mjs +117 -20
  19. package/dist/formula.mjs.map +1 -1
  20. package/dist/index.cjs +17 -4
  21. package/dist/index.d.cts +5 -5
  22. package/dist/index.d.mts +5 -5
  23. package/dist/index.mjs +5 -5
  24. package/dist/last-edited-by.cjs +27 -25
  25. package/dist/last-edited-by.cjs.map +1 -1
  26. package/dist/last-edited-by.d.cts +29 -44
  27. package/dist/last-edited-by.d.mts +29 -44
  28. package/dist/last-edited-by.mjs +28 -26
  29. package/dist/last-edited-by.mjs.map +1 -1
  30. package/dist/people.cjs +320 -38
  31. package/dist/people.cjs.map +1 -1
  32. package/dist/people.d.cts +331 -53
  33. package/dist/people.d.mts +331 -53
  34. package/dist/people.mjs +313 -39
  35. package/dist/people.mjs.map +1 -1
  36. package/dist/rollup.cjs +66 -0
  37. package/dist/rollup.cjs.map +1 -1
  38. package/dist/rollup.d.cts +70 -1
  39. package/dist/rollup.d.mts +70 -1
  40. package/dist/rollup.mjs +66 -1
  41. package/dist/rollup.mjs.map +1 -1
  42. package/dist/verification.cjs +7 -7
  43. package/dist/verification.cjs.map +1 -1
  44. package/dist/verification.d.cts +18 -12
  45. package/dist/verification.d.mts +18 -12
  46. package/dist/verification.mjs +8 -8
  47. package/dist/verification.mjs.map +1 -1
  48. package/package.json +3 -3
  49. package/dist/file.cjs.map +0 -1
  50. package/dist/file.mjs.map +0 -1
@@ -5,10 +5,8 @@ import * as v from "valibot";
5
5
  * Schema factory to extract the `formula` property result from a Notion page property.
6
6
  *
7
7
  * This is a generic schema factory that accepts another schema as a parameter,
8
- * allowing you to combine it with other schemas in this library to extract
9
- * typed formula results. The formula property in Notion can return different
10
- * types of values (string, number, boolean, or date) depending on the formula
11
- * configuration.
8
+ * allowing you to combine it with the formula, number, and date schemas in this library
9
+ * to extract typed formula results (e.g. string, number, boolean, or date formulas).
12
10
  *
13
11
  * **Input:**
14
12
  * ```
@@ -28,67 +26,54 @@ import * as v from "valibot";
28
26
  * ```
29
27
  *
30
28
  * **Output:** The output type depends on the schema passed as a parameter.
31
- * For example, if `RichTextSchema` is passed, the output will be `string`.
29
+ * For example, if `StringFormulaSchema` is passed, the output will be `string`.
32
30
  *
33
- * @param schema - A schema that validates the formula result type.
34
- * Must accept one of: string, number, boolean, or date formula results.
31
+ * @param schema - A schema that validates the formula result object.
32
+ * Use the pre-built `*FormulaSchema` helpers for string and boolean,
33
+ * `NumberSchema` / `NullableNumberSchema` for number,
34
+ * or the date schemas from this library for date formulas.
35
35
  *
36
36
  * @example
37
37
  * ```ts
38
38
  * import * as v from "valibot";
39
- * import { FormulaSchema, RichTextSchema } from "@nakanoaas/notion-valibot-utils";
39
+ * import {
40
+ * BooleanFormulaSchema,
41
+ * FormulaSchema,
42
+ * NumberSchema,
43
+ * SingleDateSchema,
44
+ * StringFormulaSchema,
45
+ * } from "@nakanoaas/notion-valibot-schema";
40
46
  *
41
47
  * const PageSchema = v.object({
42
48
  * id: v.string(),
43
49
  * properties: v.object({
44
- * FormulaText: FormulaSchema(RichTextSchema),
50
+ * FormulaText: FormulaSchema(StringFormulaSchema),
51
+ * FormulaNumber: FormulaSchema(NumberSchema),
52
+ * FormulaBoolean: FormulaSchema(BooleanFormulaSchema),
53
+ * FormulaDate: FormulaSchema(SingleDateSchema),
45
54
  * }),
46
55
  * });
47
56
  *
48
57
  * const page = await notion.pages.retrieve({ page_id: "..." });
49
58
  * const parsed = v.parse(PageSchema, page);
50
59
  * // parsed.properties.FormulaText: string
51
- * ```
52
- *
53
- * @example
54
- * ```ts
55
- * import * as v from "valibot";
56
- * import { FormulaSchema } from "@nakanoaas/notion-valibot-utils";
57
- *
58
- * // Custom schema for number formula
59
- * const NumberFormulaSchema = v.object({
60
- * type: v.literal("number"),
61
- * number: v.nullable(v.number()),
62
- * });
63
- *
64
- * const PageSchema = v.object({
65
- * id: v.string(),
66
- * properties: v.object({
67
- * FormulaNumber: FormulaSchema(NumberFormulaSchema),
68
- * }),
69
- * });
70
- *
71
- * const page = await notion.pages.retrieve({ page_id: "..." });
72
- * const parsed = v.parse(PageSchema, page);
73
- * // parsed.properties.FormulaNumber: { type: "number"; number: number | null }
60
+ * // parsed.properties.FormulaNumber: number
61
+ * // parsed.properties.FormulaBoolean: boolean
62
+ * // parsed.properties.FormulaDate: Date
74
63
  * ```
75
64
  */
76
65
  declare function FormulaSchema<S extends v.GenericSchema<{
77
- type: "string";
78
- string: string | null;
79
- } | {
80
- type: "number";
81
- number: number | null;
82
- } | {
83
- type: "boolean";
84
66
  boolean: boolean | null;
85
67
  } | {
86
- type: "date";
87
68
  date: {
88
69
  start: string;
89
70
  end: string | null;
90
71
  time_zone: string | null;
91
72
  } | null;
73
+ } | {
74
+ number: number | null;
75
+ } | {
76
+ string: string | null;
92
77
  }, unknown>>(schema: S): v.SchemaWithPipe<readonly [v.ObjectSchema<{
93
78
  readonly formula: S;
94
79
  }, undefined>, v.TransformAction<Readonly<{
@@ -116,6 +101,130 @@ declare function FormulaSchema<S extends v.GenericSchema<{
116
101
  }, S extends (v.ExactOptionalSchema<v.BaseSchema<unknown, unknown, v.BaseIssue<unknown>>, unknown> | v.NullishSchema<v.BaseSchema<unknown, unknown, v.BaseIssue<unknown>>, unknown> | v.OptionalSchema<v.BaseSchema<unknown, unknown, v.BaseIssue<unknown>>, unknown>) | (v.ExactOptionalSchemaAsync<v.BaseSchema<unknown, unknown, v.BaseIssue<unknown>> | v.BaseSchemaAsync<unknown, unknown, v.BaseIssue<unknown>>, unknown> | v.NullishSchemaAsync<v.BaseSchema<unknown, unknown, v.BaseIssue<unknown>> | v.BaseSchemaAsync<unknown, unknown, v.BaseIssue<unknown>>, unknown> | v.OptionalSchemaAsync<v.BaseSchema<unknown, unknown, v.BaseIssue<unknown>> | v.BaseSchemaAsync<unknown, unknown, v.BaseIssue<unknown>>, unknown>) ? undefined extends S["default"] ? "formula" : never : never> & Partial<Pick<{
117
102
  formula: v.InferOutput<S>;
118
103
  }, S extends (v.ExactOptionalSchema<v.BaseSchema<unknown, unknown, v.BaseIssue<unknown>>, unknown> | v.NullishSchema<v.BaseSchema<unknown, unknown, v.BaseIssue<unknown>>, unknown> | v.OptionalSchema<v.BaseSchema<unknown, unknown, v.BaseIssue<unknown>>, unknown>) | (v.ExactOptionalSchemaAsync<v.BaseSchema<unknown, unknown, v.BaseIssue<unknown>> | v.BaseSchemaAsync<unknown, unknown, v.BaseIssue<unknown>>, unknown> | v.NullishSchemaAsync<v.BaseSchema<unknown, unknown, v.BaseIssue<unknown>> | v.BaseSchemaAsync<unknown, unknown, v.BaseIssue<unknown>>, unknown> | v.OptionalSchemaAsync<v.BaseSchema<unknown, unknown, v.BaseIssue<unknown>> | v.BaseSchemaAsync<unknown, unknown, v.BaseIssue<unknown>>, unknown>) ? undefined extends S["default"] ? "formula" : never : never>>, Exclude<"formula", S extends v.SchemaWithPipe<infer TPipe extends readonly [v.BaseSchema<unknown, unknown, v.BaseIssue<unknown>>, ...v.PipeItem<any, unknown, v.BaseIssue<unknown>>[]] & readonly [v.BaseSchema<unknown, unknown, v.BaseIssue<unknown>> | v.BaseSchemaAsync<unknown, unknown, v.BaseIssue<unknown>>, ...(v.PipeItem<any, unknown, v.BaseIssue<unknown>> | v.PipeItemAsync<any, unknown, v.BaseIssue<unknown>>)[]]> | v.SchemaWithPipeAsync<infer TPipe extends readonly [v.BaseSchema<unknown, unknown, v.BaseIssue<unknown>>, ...v.PipeItem<any, unknown, v.BaseIssue<unknown>>[]] & readonly [v.BaseSchema<unknown, unknown, v.BaseIssue<unknown>> | v.BaseSchemaAsync<unknown, unknown, v.BaseIssue<unknown>>, ...(v.PipeItem<any, unknown, v.BaseIssue<unknown>> | v.PipeItemAsync<any, unknown, v.BaseIssue<unknown>>)[]]> ? v.ReadonlyAction<any> extends TPipe[number] ? "formula" : never : never> | Exclude<S extends (v.ExactOptionalSchema<v.BaseSchema<unknown, unknown, v.BaseIssue<unknown>>, unknown> | v.NullishSchema<v.BaseSchema<unknown, unknown, v.BaseIssue<unknown>>, unknown> | v.OptionalSchema<v.BaseSchema<unknown, unknown, v.BaseIssue<unknown>>, unknown>) | (v.ExactOptionalSchemaAsync<v.BaseSchema<unknown, unknown, v.BaseIssue<unknown>> | v.BaseSchemaAsync<unknown, unknown, v.BaseIssue<unknown>>, unknown> | v.NullishSchemaAsync<v.BaseSchema<unknown, unknown, v.BaseIssue<unknown>> | v.BaseSchemaAsync<unknown, unknown, v.BaseIssue<unknown>>, unknown> | v.OptionalSchemaAsync<v.BaseSchema<unknown, unknown, v.BaseIssue<unknown>> | v.BaseSchemaAsync<unknown, unknown, v.BaseIssue<unknown>>, unknown>) ? undefined extends S["default"] ? "formula" : never : never, S extends v.SchemaWithPipe<infer TPipe extends readonly [v.BaseSchema<unknown, unknown, v.BaseIssue<unknown>>, ...v.PipeItem<any, unknown, v.BaseIssue<unknown>>[]] & readonly [v.BaseSchema<unknown, unknown, v.BaseIssue<unknown>> | v.BaseSchemaAsync<unknown, unknown, v.BaseIssue<unknown>>, ...(v.PipeItem<any, unknown, v.BaseIssue<unknown>> | v.PipeItemAsync<any, unknown, v.BaseIssue<unknown>>)[]]> | v.SchemaWithPipeAsync<infer TPipe extends readonly [v.BaseSchema<unknown, unknown, v.BaseIssue<unknown>>, ...v.PipeItem<any, unknown, v.BaseIssue<unknown>>[]] & readonly [v.BaseSchema<unknown, unknown, v.BaseIssue<unknown>> | v.BaseSchemaAsync<unknown, unknown, v.BaseIssue<unknown>>, ...(v.PipeItem<any, unknown, v.BaseIssue<unknown>> | v.PipeItemAsync<any, unknown, v.BaseIssue<unknown>>)[]]> ? v.ReadonlyAction<any> extends TPipe[number] ? "formula" : never : never> | Exclude<Exclude<"formula", S extends (v.ExactOptionalSchema<v.BaseSchema<unknown, unknown, v.BaseIssue<unknown>>, unknown> | v.NullishSchema<v.BaseSchema<unknown, unknown, v.BaseIssue<unknown>>, unknown> | v.OptionalSchema<v.BaseSchema<unknown, unknown, v.BaseIssue<unknown>>, unknown>) | (v.ExactOptionalSchemaAsync<v.BaseSchema<unknown, unknown, v.BaseIssue<unknown>> | v.BaseSchemaAsync<unknown, unknown, v.BaseIssue<unknown>>, unknown> | v.NullishSchemaAsync<v.BaseSchema<unknown, unknown, v.BaseIssue<unknown>> | v.BaseSchemaAsync<unknown, unknown, v.BaseIssue<unknown>>, unknown> | v.OptionalSchemaAsync<v.BaseSchema<unknown, unknown, v.BaseIssue<unknown>> | v.BaseSchemaAsync<unknown, unknown, v.BaseIssue<unknown>>, unknown>) ? undefined extends S["default"] ? "formula" : never : never>, S extends v.SchemaWithPipe<infer TPipe extends readonly [v.BaseSchema<unknown, unknown, v.BaseIssue<unknown>>, ...v.PipeItem<any, unknown, v.BaseIssue<unknown>>[]] & readonly [v.BaseSchema<unknown, unknown, v.BaseIssue<unknown>> | v.BaseSchemaAsync<unknown, unknown, v.BaseIssue<unknown>>, ...(v.PipeItem<any, unknown, v.BaseIssue<unknown>> | v.PipeItemAsync<any, unknown, v.BaseIssue<unknown>>)[]]> | v.SchemaWithPipeAsync<infer TPipe extends readonly [v.BaseSchema<unknown, unknown, v.BaseIssue<unknown>>, ...v.PipeItem<any, unknown, v.BaseIssue<unknown>>[]] & readonly [v.BaseSchema<unknown, unknown, v.BaseIssue<unknown>> | v.BaseSchemaAsync<unknown, unknown, v.BaseIssue<unknown>>, ...(v.PipeItem<any, unknown, v.BaseIssue<unknown>> | v.PipeItemAsync<any, unknown, v.BaseIssue<unknown>>)[]]> ? v.ReadonlyAction<any> extends TPipe[number] ? "formula" : never : never>>)["formula"]>>]>;
104
+ /**
105
+ * Pre-built inner schema for a non-nullable string formula result.
106
+ *
107
+ * Validates `{ string: string }` and extracts the `string` value.
108
+ * Use with {@link FormulaSchema} when the formula is guaranteed to return a string.
109
+ *
110
+ * **Input:** `{ string: string }`
111
+ * **Output:** `string`
112
+ *
113
+ * @example
114
+ * ```ts
115
+ * import * as v from "valibot";
116
+ * import { FormulaSchema, StringFormulaSchema } from "@nakanoaas/notion-valibot-schema";
117
+ *
118
+ * const PageSchema = v.object({
119
+ * id: v.string(),
120
+ * properties: v.object({
121
+ * MyFormula: FormulaSchema(StringFormulaSchema),
122
+ * }),
123
+ * });
124
+ *
125
+ * const page = await notion.pages.retrieve({ page_id: "..." });
126
+ * const parsed = v.parse(PageSchema, page);
127
+ * // parsed.properties.MyFormula: string
128
+ * ```
129
+ */
130
+ declare const StringFormulaSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
131
+ readonly string: v.StringSchema<undefined>;
132
+ }, undefined>, v.TransformAction<{
133
+ string: string;
134
+ }, string>]>;
135
+ /**
136
+ * Pre-built inner schema for a nullable string formula result.
137
+ *
138
+ * Validates `{ string: string | null }` and extracts the `string` value.
139
+ * Use with {@link FormulaSchema} when the string formula result may be null.
140
+ *
141
+ * **Input:** `{ string: string | null }`
142
+ * **Output:** `string | null`
143
+ *
144
+ * @example
145
+ * ```ts
146
+ * import * as v from "valibot";
147
+ * import { FormulaSchema, NullableStringFormulaSchema } from "@nakanoaas/notion-valibot-schema";
148
+ *
149
+ * const PageSchema = v.object({
150
+ * id: v.string(),
151
+ * properties: v.object({
152
+ * MyFormula: FormulaSchema(NullableStringFormulaSchema),
153
+ * }),
154
+ * });
155
+ *
156
+ * const page = await notion.pages.retrieve({ page_id: "..." });
157
+ * const parsed = v.parse(PageSchema, page);
158
+ * // parsed.properties.MyFormula: string | null
159
+ * ```
160
+ */
161
+ declare const NullableStringFormulaSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
162
+ readonly string: v.NullableSchema<v.StringSchema<undefined>, undefined>;
163
+ }, undefined>, v.TransformAction<{
164
+ string: string | null;
165
+ }, string | null>]>;
166
+ /**
167
+ * Pre-built inner schema for a non-nullable boolean formula result.
168
+ *
169
+ * Validates `{ boolean: boolean }` and extracts the `boolean` value.
170
+ * Use with {@link FormulaSchema} when the formula is guaranteed to return a boolean.
171
+ *
172
+ * **Input:** `{ boolean: boolean }`
173
+ * **Output:** `boolean`
174
+ *
175
+ * @example
176
+ * ```ts
177
+ * import * as v from "valibot";
178
+ * import { FormulaSchema, BooleanFormulaSchema } from "@nakanoaas/notion-valibot-schema";
179
+ *
180
+ * const PageSchema = v.object({
181
+ * id: v.string(),
182
+ * properties: v.object({
183
+ * MyFormula: FormulaSchema(BooleanFormulaSchema),
184
+ * }),
185
+ * });
186
+ *
187
+ * const page = await notion.pages.retrieve({ page_id: "..." });
188
+ * const parsed = v.parse(PageSchema, page);
189
+ * // parsed.properties.MyFormula: boolean
190
+ * ```
191
+ */
192
+ declare const BooleanFormulaSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
193
+ readonly boolean: v.BooleanSchema<undefined>;
194
+ }, undefined>, v.TransformAction<{
195
+ boolean: boolean;
196
+ }, boolean>]>;
197
+ /**
198
+ * Pre-built inner schema for a nullable boolean formula result.
199
+ *
200
+ * Validates `{ boolean: boolean | null }` and extracts the `boolean` value.
201
+ * Use with {@link FormulaSchema} when the boolean formula result may be null.
202
+ *
203
+ * **Input:** `{ boolean: boolean | null }`
204
+ * **Output:** `boolean | null`
205
+ *
206
+ * @example
207
+ * ```ts
208
+ * import * as v from "valibot";
209
+ * import { FormulaSchema, NullableBooleanFormulaSchema } from "@nakanoaas/notion-valibot-schema";
210
+ *
211
+ * const PageSchema = v.object({
212
+ * id: v.string(),
213
+ * properties: v.object({
214
+ * MyFormula: FormulaSchema(NullableBooleanFormulaSchema),
215
+ * }),
216
+ * });
217
+ *
218
+ * const page = await notion.pages.retrieve({ page_id: "..." });
219
+ * const parsed = v.parse(PageSchema, page);
220
+ * // parsed.properties.MyFormula: boolean | null
221
+ * ```
222
+ */
223
+ declare const NullableBooleanFormulaSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
224
+ readonly boolean: v.NullableSchema<v.BooleanSchema<undefined>, undefined>;
225
+ }, undefined>, v.TransformAction<{
226
+ boolean: boolean | null;
227
+ }, boolean | null>]>;
119
228
  //#endregion
120
- export { FormulaSchema };
229
+ export { BooleanFormulaSchema, FormulaSchema, NullableBooleanFormulaSchema, NullableStringFormulaSchema, StringFormulaSchema };
121
230
  //# sourceMappingURL=formula.d.mts.map
package/dist/formula.mjs CHANGED
@@ -4,10 +4,8 @@ import * as v from "valibot";
4
4
  * Schema factory to extract the `formula` property result from a Notion page property.
5
5
  *
6
6
  * This is a generic schema factory that accepts another schema as a parameter,
7
- * allowing you to combine it with other schemas in this library to extract
8
- * typed formula results. The formula property in Notion can return different
9
- * types of values (string, number, boolean, or date) depending on the formula
10
- * configuration.
7
+ * allowing you to combine it with the formula, number, and date schemas in this library
8
+ * to extract typed formula results (e.g. string, number, boolean, or date formulas).
11
9
  *
12
10
  * **Input:**
13
11
  * ```
@@ -27,55 +25,154 @@ import * as v from "valibot";
27
25
  * ```
28
26
  *
29
27
  * **Output:** The output type depends on the schema passed as a parameter.
30
- * For example, if `RichTextSchema` is passed, the output will be `string`.
28
+ * For example, if `StringFormulaSchema` is passed, the output will be `string`.
31
29
  *
32
- * @param schema - A schema that validates the formula result type.
33
- * Must accept one of: string, number, boolean, or date formula results.
30
+ * @param schema - A schema that validates the formula result object.
31
+ * Use the pre-built `*FormulaSchema` helpers for string and boolean,
32
+ * `NumberSchema` / `NullableNumberSchema` for number,
33
+ * or the date schemas from this library for date formulas.
34
34
  *
35
35
  * @example
36
36
  * ```ts
37
37
  * import * as v from "valibot";
38
- * import { FormulaSchema, RichTextSchema } from "@nakanoaas/notion-valibot-utils";
38
+ * import {
39
+ * BooleanFormulaSchema,
40
+ * FormulaSchema,
41
+ * NumberSchema,
42
+ * SingleDateSchema,
43
+ * StringFormulaSchema,
44
+ * } from "@nakanoaas/notion-valibot-schema";
39
45
  *
40
46
  * const PageSchema = v.object({
41
47
  * id: v.string(),
42
48
  * properties: v.object({
43
- * FormulaText: FormulaSchema(RichTextSchema),
49
+ * FormulaText: FormulaSchema(StringFormulaSchema),
50
+ * FormulaNumber: FormulaSchema(NumberSchema),
51
+ * FormulaBoolean: FormulaSchema(BooleanFormulaSchema),
52
+ * FormulaDate: FormulaSchema(SingleDateSchema),
44
53
  * }),
45
54
  * });
46
55
  *
47
56
  * const page = await notion.pages.retrieve({ page_id: "..." });
48
57
  * const parsed = v.parse(PageSchema, page);
49
58
  * // parsed.properties.FormulaText: string
59
+ * // parsed.properties.FormulaNumber: number
60
+ * // parsed.properties.FormulaBoolean: boolean
61
+ * // parsed.properties.FormulaDate: Date
50
62
  * ```
63
+ */
64
+ function FormulaSchema(schema) {
65
+ return v.pipe(v.object({ formula: schema }), v.transform((v) => v.formula));
66
+ }
67
+ /**
68
+ * Pre-built inner schema for a non-nullable string formula result.
69
+ *
70
+ * Validates `{ string: string }` and extracts the `string` value.
71
+ * Use with {@link FormulaSchema} when the formula is guaranteed to return a string.
72
+ *
73
+ * **Input:** `{ string: string }`
74
+ * **Output:** `string`
51
75
  *
52
76
  * @example
53
77
  * ```ts
54
78
  * import * as v from "valibot";
55
- * import { FormulaSchema } from "@nakanoaas/notion-valibot-utils";
79
+ * import { FormulaSchema, StringFormulaSchema } from "@nakanoaas/notion-valibot-schema";
56
80
  *
57
- * // Custom schema for number formula
58
- * const NumberFormulaSchema = v.object({
59
- * type: v.literal("number"),
60
- * number: v.nullable(v.number()),
81
+ * const PageSchema = v.object({
82
+ * id: v.string(),
83
+ * properties: v.object({
84
+ * MyFormula: FormulaSchema(StringFormulaSchema),
85
+ * }),
61
86
  * });
62
87
  *
88
+ * const page = await notion.pages.retrieve({ page_id: "..." });
89
+ * const parsed = v.parse(PageSchema, page);
90
+ * // parsed.properties.MyFormula: string
91
+ * ```
92
+ */
93
+ const StringFormulaSchema = v.pipe(v.object({ string: v.string() }), v.transform((v) => v.string));
94
+ /**
95
+ * Pre-built inner schema for a nullable string formula result.
96
+ *
97
+ * Validates `{ string: string | null }` and extracts the `string` value.
98
+ * Use with {@link FormulaSchema} when the string formula result may be null.
99
+ *
100
+ * **Input:** `{ string: string | null }`
101
+ * **Output:** `string | null`
102
+ *
103
+ * @example
104
+ * ```ts
105
+ * import * as v from "valibot";
106
+ * import { FormulaSchema, NullableStringFormulaSchema } from "@nakanoaas/notion-valibot-schema";
107
+ *
63
108
  * const PageSchema = v.object({
64
109
  * id: v.string(),
65
110
  * properties: v.object({
66
- * FormulaNumber: FormulaSchema(NumberFormulaSchema),
111
+ * MyFormula: FormulaSchema(NullableStringFormulaSchema),
67
112
  * }),
68
113
  * });
69
114
  *
70
115
  * const page = await notion.pages.retrieve({ page_id: "..." });
71
116
  * const parsed = v.parse(PageSchema, page);
72
- * // parsed.properties.FormulaNumber: { type: "number"; number: number | null }
117
+ * // parsed.properties.MyFormula: string | null
73
118
  * ```
74
119
  */
75
- function FormulaSchema(schema) {
76
- return v.pipe(v.object({ formula: schema }), v.transform((v) => v.formula));
77
- }
120
+ const NullableStringFormulaSchema = v.pipe(v.object({ string: v.nullable(v.string()) }), v.transform((v) => v.string));
121
+ /**
122
+ * Pre-built inner schema for a non-nullable boolean formula result.
123
+ *
124
+ * Validates `{ boolean: boolean }` and extracts the `boolean` value.
125
+ * Use with {@link FormulaSchema} when the formula is guaranteed to return a boolean.
126
+ *
127
+ * **Input:** `{ boolean: boolean }`
128
+ * **Output:** `boolean`
129
+ *
130
+ * @example
131
+ * ```ts
132
+ * import * as v from "valibot";
133
+ * import { FormulaSchema, BooleanFormulaSchema } from "@nakanoaas/notion-valibot-schema";
134
+ *
135
+ * const PageSchema = v.object({
136
+ * id: v.string(),
137
+ * properties: v.object({
138
+ * MyFormula: FormulaSchema(BooleanFormulaSchema),
139
+ * }),
140
+ * });
141
+ *
142
+ * const page = await notion.pages.retrieve({ page_id: "..." });
143
+ * const parsed = v.parse(PageSchema, page);
144
+ * // parsed.properties.MyFormula: boolean
145
+ * ```
146
+ */
147
+ const BooleanFormulaSchema = v.pipe(v.object({ boolean: v.boolean() }), v.transform((v) => v.boolean));
148
+ /**
149
+ * Pre-built inner schema for a nullable boolean formula result.
150
+ *
151
+ * Validates `{ boolean: boolean | null }` and extracts the `boolean` value.
152
+ * Use with {@link FormulaSchema} when the boolean formula result may be null.
153
+ *
154
+ * **Input:** `{ boolean: boolean | null }`
155
+ * **Output:** `boolean | null`
156
+ *
157
+ * @example
158
+ * ```ts
159
+ * import * as v from "valibot";
160
+ * import { FormulaSchema, NullableBooleanFormulaSchema } from "@nakanoaas/notion-valibot-schema";
161
+ *
162
+ * const PageSchema = v.object({
163
+ * id: v.string(),
164
+ * properties: v.object({
165
+ * MyFormula: FormulaSchema(NullableBooleanFormulaSchema),
166
+ * }),
167
+ * });
168
+ *
169
+ * const page = await notion.pages.retrieve({ page_id: "..." });
170
+ * const parsed = v.parse(PageSchema, page);
171
+ * // parsed.properties.MyFormula: boolean | null
172
+ * ```
173
+ */
174
+ const NullableBooleanFormulaSchema = v.pipe(v.object({ boolean: v.nullable(v.boolean()) }), v.transform((v) => v.boolean));
78
175
  //#endregion
79
- export { FormulaSchema };
176
+ export { BooleanFormulaSchema, FormulaSchema, NullableBooleanFormulaSchema, NullableStringFormulaSchema, StringFormulaSchema };
80
177
 
81
178
  //# sourceMappingURL=formula.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"formula.mjs","names":[],"sources":["../src/formula.ts"],"sourcesContent":["import * as v from \"valibot\";\n\n/**\n * Schema factory to extract the `formula` property result 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 formula results. The formula property in Notion can return different\n * types of values (string, number, boolean, or date) depending on the formula\n * configuration.\n *\n * **Input:**\n * ```\n * {\n * formula: {\n * type: \"string\" | \"number\" | \"boolean\" | \"date\";\n * string?: string | null;\n * number?: number | null;\n * boolean?: boolean | null;\n * date?: {\n * start: string;\n * end: string | null;\n * time_zone: string | null;\n * } | null;\n * }\n * }\n * ```\n *\n * **Output:** The output type depends on the schema passed as a parameter.\n * For example, if `RichTextSchema` is passed, the output will be `string`.\n *\n * @param schema - A schema that validates the formula result type.\n * Must accept one of: string, number, boolean, or date formula results.\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { FormulaSchema, RichTextSchema } from \"@nakanoaas/notion-valibot-utils\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * FormulaText: FormulaSchema(RichTextSchema),\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.FormulaText: string\n * ```\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { FormulaSchema } from \"@nakanoaas/notion-valibot-utils\";\n *\n * // Custom schema for number formula\n * const NumberFormulaSchema = v.object({\n * type: v.literal(\"number\"),\n * number: v.nullable(v.number()),\n * });\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * FormulaNumber: FormulaSchema(NumberFormulaSchema),\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.FormulaNumber: { type: \"number\"; number: number | null }\n * ```\n */\nexport function FormulaSchema<\n\tS extends v.GenericSchema<\n\t\t| { type: \"string\"; string: string | null }\n\t\t| { type: \"number\"; number: number | null }\n\t\t| { type: \"boolean\"; boolean: boolean | null }\n\t\t| {\n\t\t\t\ttype: \"date\";\n\t\t\t\tdate: {\n\t\t\t\t\tstart: string;\n\t\t\t\t\tend: string | null;\n\t\t\t\t\ttime_zone: string | null;\n\t\t\t\t} | null;\n\t\t },\n\t\tunknown\n\t>,\n>(schema: S) {\n\treturn v.pipe(\n\t\tv.object({\n\t\t\tformula: schema,\n\t\t}),\n\t\t// biome-ignore lint/style/noNonNullAssertion: valibot inference is not working correctly\n\t\tv.transform((v) => v.formula!),\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0EA,SAAgB,cAed,QAAW;CACZ,OAAO,EAAE,KACR,EAAE,OAAO,EACR,SAAS,OACV,CAAC,GAED,EAAE,WAAW,MAAM,EAAE,OAAQ,CAC9B;AACD"}
1
+ {"version":3,"file":"formula.mjs","names":[],"sources":["../src/formula.ts"],"sourcesContent":["import * as v from \"valibot\";\n\n/**\n * Schema factory to extract the `formula` property result 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 the formula, number, and date schemas in this library\n * to extract typed formula results (e.g. string, number, boolean, or date formulas).\n *\n * **Input:**\n * ```\n * {\n * formula: {\n * type: \"string\" | \"number\" | \"boolean\" | \"date\";\n * string?: string | null;\n * number?: number | null;\n * boolean?: boolean | null;\n * date?: {\n * start: string;\n * end: string | null;\n * time_zone: string | null;\n * } | null;\n * }\n * }\n * ```\n *\n * **Output:** The output type depends on the schema passed as a parameter.\n * For example, if `StringFormulaSchema` is passed, the output will be `string`.\n *\n * @param schema - A schema that validates the formula result object.\n * Use the pre-built `*FormulaSchema` helpers for string and boolean,\n * `NumberSchema` / `NullableNumberSchema` for number,\n * or the date schemas from this library for date formulas.\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import {\n * BooleanFormulaSchema,\n * FormulaSchema,\n * NumberSchema,\n * SingleDateSchema,\n * StringFormulaSchema,\n * } from \"@nakanoaas/notion-valibot-schema\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * FormulaText: FormulaSchema(StringFormulaSchema),\n * FormulaNumber: FormulaSchema(NumberSchema),\n * FormulaBoolean: FormulaSchema(BooleanFormulaSchema),\n * FormulaDate: FormulaSchema(SingleDateSchema),\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.FormulaText: string\n * // parsed.properties.FormulaNumber: number\n * // parsed.properties.FormulaBoolean: boolean\n * // parsed.properties.FormulaDate: Date\n * ```\n */\nexport function FormulaSchema<\n\tS extends v.GenericSchema<\n\t\t| { boolean: boolean | null }\n\t\t| {\n\t\t\t\tdate: {\n\t\t\t\t\tstart: string;\n\t\t\t\t\tend: string | null;\n\t\t\t\t\ttime_zone: string | null;\n\t\t\t\t} | null;\n\t\t }\n\t\t| { number: number | null }\n\t\t| { string: string | null },\n\t\tunknown\n\t>,\n>(schema: S) {\n\treturn v.pipe(\n\t\tv.object({\n\t\t\tformula: schema,\n\t\t}),\n\t\t// biome-ignore lint/style/noNonNullAssertion: valibot inference is not working correctly\n\t\tv.transform((v) => v.formula!),\n\t);\n}\n\n/**\n * Pre-built inner schema for a non-nullable string formula result.\n *\n * Validates `{ string: string }` and extracts the `string` value.\n * Use with {@link FormulaSchema} when the formula is guaranteed to return a string.\n *\n * **Input:** `{ string: string }`\n * **Output:** `string`\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { FormulaSchema, StringFormulaSchema } from \"@nakanoaas/notion-valibot-schema\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * MyFormula: FormulaSchema(StringFormulaSchema),\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.MyFormula: string\n * ```\n */\nexport const StringFormulaSchema = v.pipe(\n\tv.object({\n\t\tstring: v.string(),\n\t}),\n\tv.transform((v) => v.string),\n);\n\n/**\n * Pre-built inner schema for a nullable string formula result.\n *\n * Validates `{ string: string | null }` and extracts the `string` value.\n * Use with {@link FormulaSchema} when the string formula result may be null.\n *\n * **Input:** `{ string: string | null }`\n * **Output:** `string | null`\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { FormulaSchema, NullableStringFormulaSchema } from \"@nakanoaas/notion-valibot-schema\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * MyFormula: FormulaSchema(NullableStringFormulaSchema),\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.MyFormula: string | null\n * ```\n */\nexport const NullableStringFormulaSchema = v.pipe(\n\tv.object({\n\t\tstring: v.nullable(v.string()),\n\t}),\n\tv.transform((v) => v.string),\n);\n\n/**\n * Pre-built inner schema for a non-nullable boolean formula result.\n *\n * Validates `{ boolean: boolean }` and extracts the `boolean` value.\n * Use with {@link FormulaSchema} when the formula is guaranteed to return a boolean.\n *\n * **Input:** `{ boolean: boolean }`\n * **Output:** `boolean`\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { FormulaSchema, BooleanFormulaSchema } from \"@nakanoaas/notion-valibot-schema\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * MyFormula: FormulaSchema(BooleanFormulaSchema),\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.MyFormula: boolean\n * ```\n */\nexport const BooleanFormulaSchema = v.pipe(\n\tv.object({\n\t\tboolean: v.boolean(),\n\t}),\n\tv.transform((v) => v.boolean),\n);\n\n/**\n * Pre-built inner schema for a nullable boolean formula result.\n *\n * Validates `{ boolean: boolean | null }` and extracts the `boolean` value.\n * Use with {@link FormulaSchema} when the boolean formula result may be null.\n *\n * **Input:** `{ boolean: boolean | null }`\n * **Output:** `boolean | null`\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { FormulaSchema, NullableBooleanFormulaSchema } from \"@nakanoaas/notion-valibot-schema\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * MyFormula: FormulaSchema(NullableBooleanFormulaSchema),\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.MyFormula: boolean | null\n * ```\n */\nexport const NullableBooleanFormulaSchema = v.pipe(\n\tv.object({\n\t\tboolean: v.nullable(v.boolean()),\n\t}),\n\tv.transform((v) => v.boolean),\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+DA,SAAgB,cAcd,QAAW;CACZ,OAAO,EAAE,KACR,EAAE,OAAO,EACR,SAAS,OACV,CAAC,GAED,EAAE,WAAW,MAAM,EAAE,OAAQ,CAC9B;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,MAAa,sBAAsB,EAAE,KACpC,EAAE,OAAO,EACR,QAAQ,EAAE,OAAO,EAClB,CAAC,GACD,EAAE,WAAW,MAAM,EAAE,MAAM,CAC5B;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,MAAa,8BAA8B,EAAE,KAC5C,EAAE,OAAO,EACR,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC,EAC9B,CAAC,GACD,EAAE,WAAW,MAAM,EAAE,MAAM,CAC5B;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,MAAa,uBAAuB,EAAE,KACrC,EAAE,OAAO,EACR,SAAS,EAAE,QAAQ,EACpB,CAAC,GACD,EAAE,WAAW,MAAM,EAAE,OAAO,CAC7B;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,MAAa,+BAA+B,EAAE,KAC7C,EAAE,OAAO,EACR,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAC,EAChC,CAAC,GACD,EAAE,WAAW,MAAM,EAAE,OAAO,CAC7B"}
package/dist/index.cjs CHANGED
@@ -5,7 +5,7 @@ const require_created_by = require("./created-by.cjs");
5
5
  const require_created_time = require("./created-time.cjs");
6
6
  const require_date = require("./date.cjs");
7
7
  const require_email = require("./email.cjs");
8
- const require_file = require("./file.cjs");
8
+ const require_files = require("./files.cjs");
9
9
  const require_formula = require("./formula.cjs");
10
10
  const require_last_edited_by = require("./last-edited-by.cjs");
11
11
  const require_last_edited_time = require("./last-edited-time.cjs");
@@ -21,19 +21,22 @@ const require_text = require("./text.cjs");
21
21
  const require_unique_id = require("./unique-id.cjs");
22
22
  const require_url = require("./url.cjs");
23
23
  const require_verification = require("./verification.cjs");
24
+ exports.BooleanFormulaSchema = require_formula.BooleanFormulaSchema;
25
+ exports.BotSchema = require_people.BotSchema;
24
26
  exports.CheckboxSchema = require_checkbox.CheckboxSchema;
25
27
  exports.CreatedByIdSchema = require_created_by.CreatedByIdSchema;
26
28
  exports.CreatedBySchema = require_created_by.CreatedBySchema;
27
29
  exports.CreatedTimeSchema = require_created_time.CreatedTimeSchema;
28
30
  exports.DateObjectSchema = require_date.DateObjectSchema;
29
31
  exports.EmailSchema = require_email.EmailSchema;
30
- exports.FileArraySchema = require_file.FileArraySchema;
32
+ exports.FileSchema = require_files.FileSchema;
31
33
  exports.FormulaSchema = require_formula.FormulaSchema;
32
34
  exports.FullDateSchema = require_date.FullDateSchema;
33
35
  exports.LastEditedByIdSchema = require_last_edited_by.LastEditedByIdSchema;
34
36
  exports.LastEditedBySchema = require_last_edited_by.LastEditedBySchema;
35
37
  exports.LastEditedTimeSchema = require_last_edited_time.LastEditedTimeSchema;
36
38
  exports.MultiSelectSchema = require_multi_select.MultiSelectSchema;
39
+ exports.NullableBooleanFormulaSchema = require_formula.NullableBooleanFormulaSchema;
37
40
  exports.NullableCreatedByNameSchema = require_created_by.NullableCreatedByNameSchema;
38
41
  exports.NullableEmailSchema = require_email.NullableEmailSchema;
39
42
  exports.NullableFullDateSchema = require_date.NullableFullDateSchema;
@@ -47,10 +50,13 @@ exports.NullableRollupDateSchema = require_rollup.NullableRollupDateSchema;
47
50
  exports.NullableRollupNumberSchema = require_rollup.NullableRollupNumberSchema;
48
51
  exports.NullableSelectSchema = require_select.NullableSelectSchema;
49
52
  exports.NullableSingleDateSchema = require_date.NullableSingleDateSchema;
50
- exports.NullableSingleFileSchema = require_file.NullableSingleFileSchema;
53
+ exports.NullableSingleFileSchema = require_files.NullableSingleFileSchema;
54
+ exports.NullableSinglePeopleIdSchema = require_people.NullableSinglePeopleIdSchema;
55
+ exports.NullableSinglePeopleSchema = require_people.NullableSinglePeopleSchema;
51
56
  exports.NullableSingleRelationSchema = require_relation.NullableSingleRelationSchema;
52
57
  exports.NullableSingleRollupArraySchema = require_rollup.NullableSingleRollupArraySchema;
53
58
  exports.NullableStatusSchema = require_status.NullableStatusSchema;
59
+ exports.NullableStringFormulaSchema = require_formula.NullableStringFormulaSchema;
54
60
  exports.NullableTitleSchema = require_text.NullableTitleSchema;
55
61
  exports.NullableUniqueIdSchema = require_unique_id.NullableUniqueIdSchema;
56
62
  exports.NullableUrlSchema = require_url.NullableUrlSchema;
@@ -67,13 +73,20 @@ exports.RichTextSchema = require_text.RichTextSchema;
67
73
  exports.RollupArraySchema = require_rollup.RollupArraySchema;
68
74
  exports.RollupDateSchema = require_rollup.RollupDateSchema;
69
75
  exports.RollupNumberSchema = require_rollup.RollupNumberSchema;
76
+ exports.RollupSimpleSchema = require_rollup.RollupSimpleSchema;
70
77
  exports.SelectSchema = require_select.SelectSchema;
71
78
  exports.SingleDateSchema = require_date.SingleDateSchema;
72
- exports.SingleFileSchema = require_file.SingleFileSchema;
79
+ exports.SingleFileSchema = require_files.SingleFileSchema;
80
+ exports.SinglePeopleIdSchema = require_people.SinglePeopleIdSchema;
81
+ exports.SinglePeopleSchema = require_people.SinglePeopleSchema;
73
82
  exports.SingleRelationSchema = require_relation.SingleRelationSchema;
74
83
  exports.SingleRollupArraySchema = require_rollup.SingleRollupArraySchema;
75
84
  exports.StatusSchema = require_status.StatusSchema;
85
+ exports.StringFormulaSchema = require_formula.StringFormulaSchema;
76
86
  exports.TitleSchema = require_text.TitleSchema;
77
87
  exports.UniqueIdNumberSchema = require_unique_id.UniqueIdNumberSchema;
78
88
  exports.UrlSchema = require_url.UrlSchema;
89
+ exports.UserOrGroupIdSchema = require_people.UserOrGroupIdSchema;
90
+ exports.UserOrGroupSchema = require_people.UserOrGroupSchema;
91
+ exports.UserSchema = require_people.UserSchema;
79
92
  exports.VerificationSchema = require_verification.VerificationSchema;
package/dist/index.d.cts CHANGED
@@ -3,21 +3,21 @@ import { CreatedByIdSchema, CreatedBySchema, NullableCreatedByNameSchema } from
3
3
  import { CreatedTimeSchema } from "./created-time.cjs";
4
4
  import { DateObjectSchema, FullDateSchema, NullableFullDateSchema, NullableRangeDateSchema, NullableSingleDateSchema, RangeDateSchema, SingleDateSchema } from "./date.cjs";
5
5
  import { EmailSchema, NullableEmailSchema } from "./email.cjs";
6
- import { FileArraySchema, NullableSingleFileSchema, SingleFileSchema } from "./file.cjs";
7
- import { FormulaSchema } from "./formula.cjs";
6
+ import { FileSchema, NullableSingleFileSchema, SingleFileSchema } from "./files.cjs";
7
+ import { BooleanFormulaSchema, FormulaSchema, NullableBooleanFormulaSchema, NullableStringFormulaSchema, StringFormulaSchema } from "./formula.cjs";
8
8
  import { LastEditedByIdSchema, LastEditedBySchema, NullableLastEditedByNameSchema } from "./last-edited-by.cjs";
9
9
  import { LastEditedTimeSchema } from "./last-edited-time.cjs";
10
10
  import { MultiSelectSchema } from "./multi-select.cjs";
11
11
  import { NullableNumberSchema, NumberSchema } from "./number.cjs";
12
- import { PeopleIdSchema, PeopleSchema, PersonSchema } from "./people.cjs";
12
+ import { BotSchema, NullableSinglePeopleIdSchema, NullableSinglePeopleSchema, PeopleIdSchema, PeopleSchema, PersonSchema, SinglePeopleIdSchema, SinglePeopleSchema, UserOrGroupIdSchema, UserOrGroupSchema, UserSchema } from "./people.cjs";
13
13
  import { NullablePhoneNumberSchema, PhoneNumberSchema } from "./phone-number.cjs";
14
14
  import { NullablePlaceSchema, PlaceSchema } from "./place.cjs";
15
15
  import { NullableSingleRelationSchema, RelationSchema, SingleRelationSchema } from "./relation.cjs";
16
- import { NullableRollupDateSchema, NullableRollupNumberSchema, NullableSingleRollupArraySchema, RollupArraySchema, RollupDateSchema, RollupNumberSchema, SingleRollupArraySchema } from "./rollup.cjs";
16
+ import { NullableRollupDateSchema, NullableRollupNumberSchema, NullableSingleRollupArraySchema, RollupArraySchema, RollupDateSchema, RollupNumberSchema, RollupSimpleSchema, SingleRollupArraySchema } from "./rollup.cjs";
17
17
  import { NullableSelectSchema, SelectSchema } from "./select.cjs";
18
18
  import { NullableStatusSchema, StatusSchema } from "./status.cjs";
19
19
  import { NullableRichTextSchema, NullableTitleSchema, RichTextSchema, TitleSchema } from "./text.cjs";
20
20
  import { NullableUniqueIdSchema, UniqueIdNumberSchema } from "./unique-id.cjs";
21
21
  import { NullableUrlSchema, UrlSchema } from "./url.cjs";
22
22
  import { NullableVerificationSchema, VerificationSchema } from "./verification.cjs";
23
- export { CheckboxSchema, CreatedByIdSchema, CreatedBySchema, CreatedTimeSchema, DateObjectSchema, EmailSchema, FileArraySchema, FormulaSchema, FullDateSchema, LastEditedByIdSchema, LastEditedBySchema, LastEditedTimeSchema, MultiSelectSchema, NullableCreatedByNameSchema, NullableEmailSchema, NullableFullDateSchema, NullableLastEditedByNameSchema, NullableNumberSchema, NullablePhoneNumberSchema, NullablePlaceSchema, NullableRangeDateSchema, NullableRichTextSchema, NullableRollupDateSchema, NullableRollupNumberSchema, NullableSelectSchema, NullableSingleDateSchema, NullableSingleFileSchema, NullableSingleRelationSchema, NullableSingleRollupArraySchema, NullableStatusSchema, NullableTitleSchema, NullableUniqueIdSchema, NullableUrlSchema, NullableVerificationSchema, NumberSchema, PeopleIdSchema, PeopleSchema, PersonSchema, PhoneNumberSchema, PlaceSchema, RangeDateSchema, RelationSchema, RichTextSchema, RollupArraySchema, RollupDateSchema, RollupNumberSchema, SelectSchema, SingleDateSchema, SingleFileSchema, SingleRelationSchema, SingleRollupArraySchema, StatusSchema, TitleSchema, UniqueIdNumberSchema, UrlSchema, VerificationSchema };
23
+ export { BooleanFormulaSchema, BotSchema, CheckboxSchema, CreatedByIdSchema, CreatedBySchema, CreatedTimeSchema, DateObjectSchema, EmailSchema, FileSchema, FormulaSchema, FullDateSchema, LastEditedByIdSchema, LastEditedBySchema, LastEditedTimeSchema, MultiSelectSchema, NullableBooleanFormulaSchema, NullableCreatedByNameSchema, NullableEmailSchema, NullableFullDateSchema, NullableLastEditedByNameSchema, NullableNumberSchema, NullablePhoneNumberSchema, NullablePlaceSchema, NullableRangeDateSchema, NullableRichTextSchema, NullableRollupDateSchema, NullableRollupNumberSchema, NullableSelectSchema, NullableSingleDateSchema, NullableSingleFileSchema, NullableSinglePeopleIdSchema, NullableSinglePeopleSchema, NullableSingleRelationSchema, NullableSingleRollupArraySchema, NullableStatusSchema, NullableStringFormulaSchema, NullableTitleSchema, NullableUniqueIdSchema, NullableUrlSchema, NullableVerificationSchema, NumberSchema, PeopleIdSchema, PeopleSchema, PersonSchema, PhoneNumberSchema, PlaceSchema, RangeDateSchema, RelationSchema, RichTextSchema, RollupArraySchema, RollupDateSchema, RollupNumberSchema, RollupSimpleSchema, SelectSchema, SingleDateSchema, SingleFileSchema, SinglePeopleIdSchema, SinglePeopleSchema, SingleRelationSchema, SingleRollupArraySchema, StatusSchema, StringFormulaSchema, TitleSchema, UniqueIdNumberSchema, UrlSchema, UserOrGroupIdSchema, UserOrGroupSchema, UserSchema, VerificationSchema };
package/dist/index.d.mts CHANGED
@@ -3,21 +3,21 @@ import { CreatedByIdSchema, CreatedBySchema, NullableCreatedByNameSchema } from
3
3
  import { CreatedTimeSchema } from "./created-time.mjs";
4
4
  import { DateObjectSchema, FullDateSchema, NullableFullDateSchema, NullableRangeDateSchema, NullableSingleDateSchema, RangeDateSchema, SingleDateSchema } from "./date.mjs";
5
5
  import { EmailSchema, NullableEmailSchema } from "./email.mjs";
6
- import { FileArraySchema, NullableSingleFileSchema, SingleFileSchema } from "./file.mjs";
7
- import { FormulaSchema } from "./formula.mjs";
6
+ import { FileSchema, NullableSingleFileSchema, SingleFileSchema } from "./files.mjs";
7
+ import { BooleanFormulaSchema, FormulaSchema, NullableBooleanFormulaSchema, NullableStringFormulaSchema, StringFormulaSchema } from "./formula.mjs";
8
8
  import { LastEditedByIdSchema, LastEditedBySchema, NullableLastEditedByNameSchema } from "./last-edited-by.mjs";
9
9
  import { LastEditedTimeSchema } from "./last-edited-time.mjs";
10
10
  import { MultiSelectSchema } from "./multi-select.mjs";
11
11
  import { NullableNumberSchema, NumberSchema } from "./number.mjs";
12
- import { PeopleIdSchema, PeopleSchema, PersonSchema } from "./people.mjs";
12
+ import { BotSchema, NullableSinglePeopleIdSchema, NullableSinglePeopleSchema, PeopleIdSchema, PeopleSchema, PersonSchema, SinglePeopleIdSchema, SinglePeopleSchema, UserOrGroupIdSchema, UserOrGroupSchema, UserSchema } from "./people.mjs";
13
13
  import { NullablePhoneNumberSchema, PhoneNumberSchema } from "./phone-number.mjs";
14
14
  import { NullablePlaceSchema, PlaceSchema } from "./place.mjs";
15
15
  import { NullableSingleRelationSchema, RelationSchema, SingleRelationSchema } from "./relation.mjs";
16
- import { NullableRollupDateSchema, NullableRollupNumberSchema, NullableSingleRollupArraySchema, RollupArraySchema, RollupDateSchema, RollupNumberSchema, SingleRollupArraySchema } from "./rollup.mjs";
16
+ import { NullableRollupDateSchema, NullableRollupNumberSchema, NullableSingleRollupArraySchema, RollupArraySchema, RollupDateSchema, RollupNumberSchema, RollupSimpleSchema, SingleRollupArraySchema } from "./rollup.mjs";
17
17
  import { NullableSelectSchema, SelectSchema } from "./select.mjs";
18
18
  import { NullableStatusSchema, StatusSchema } from "./status.mjs";
19
19
  import { NullableRichTextSchema, NullableTitleSchema, RichTextSchema, TitleSchema } from "./text.mjs";
20
20
  import { NullableUniqueIdSchema, UniqueIdNumberSchema } from "./unique-id.mjs";
21
21
  import { NullableUrlSchema, UrlSchema } from "./url.mjs";
22
22
  import { NullableVerificationSchema, VerificationSchema } from "./verification.mjs";
23
- export { CheckboxSchema, CreatedByIdSchema, CreatedBySchema, CreatedTimeSchema, DateObjectSchema, EmailSchema, FileArraySchema, FormulaSchema, FullDateSchema, LastEditedByIdSchema, LastEditedBySchema, LastEditedTimeSchema, MultiSelectSchema, NullableCreatedByNameSchema, NullableEmailSchema, NullableFullDateSchema, NullableLastEditedByNameSchema, NullableNumberSchema, NullablePhoneNumberSchema, NullablePlaceSchema, NullableRangeDateSchema, NullableRichTextSchema, NullableRollupDateSchema, NullableRollupNumberSchema, NullableSelectSchema, NullableSingleDateSchema, NullableSingleFileSchema, NullableSingleRelationSchema, NullableSingleRollupArraySchema, NullableStatusSchema, NullableTitleSchema, NullableUniqueIdSchema, NullableUrlSchema, NullableVerificationSchema, NumberSchema, PeopleIdSchema, PeopleSchema, PersonSchema, PhoneNumberSchema, PlaceSchema, RangeDateSchema, RelationSchema, RichTextSchema, RollupArraySchema, RollupDateSchema, RollupNumberSchema, SelectSchema, SingleDateSchema, SingleFileSchema, SingleRelationSchema, SingleRollupArraySchema, StatusSchema, TitleSchema, UniqueIdNumberSchema, UrlSchema, VerificationSchema };
23
+ export { BooleanFormulaSchema, BotSchema, CheckboxSchema, CreatedByIdSchema, CreatedBySchema, CreatedTimeSchema, DateObjectSchema, EmailSchema, FileSchema, FormulaSchema, FullDateSchema, LastEditedByIdSchema, LastEditedBySchema, LastEditedTimeSchema, MultiSelectSchema, NullableBooleanFormulaSchema, NullableCreatedByNameSchema, NullableEmailSchema, NullableFullDateSchema, NullableLastEditedByNameSchema, NullableNumberSchema, NullablePhoneNumberSchema, NullablePlaceSchema, NullableRangeDateSchema, NullableRichTextSchema, NullableRollupDateSchema, NullableRollupNumberSchema, NullableSelectSchema, NullableSingleDateSchema, NullableSingleFileSchema, NullableSinglePeopleIdSchema, NullableSinglePeopleSchema, NullableSingleRelationSchema, NullableSingleRollupArraySchema, NullableStatusSchema, NullableStringFormulaSchema, NullableTitleSchema, NullableUniqueIdSchema, NullableUrlSchema, NullableVerificationSchema, NumberSchema, PeopleIdSchema, PeopleSchema, PersonSchema, PhoneNumberSchema, PlaceSchema, RangeDateSchema, RelationSchema, RichTextSchema, RollupArraySchema, RollupDateSchema, RollupNumberSchema, RollupSimpleSchema, SelectSchema, SingleDateSchema, SingleFileSchema, SinglePeopleIdSchema, SinglePeopleSchema, SingleRelationSchema, SingleRollupArraySchema, StatusSchema, StringFormulaSchema, TitleSchema, UniqueIdNumberSchema, UrlSchema, UserOrGroupIdSchema, UserOrGroupSchema, UserSchema, VerificationSchema };
package/dist/index.mjs CHANGED
@@ -1,11 +1,11 @@
1
1
  import { CheckboxSchema } from "./checkbox.mjs";
2
- import { PeopleIdSchema, PeopleSchema, PersonSchema } from "./people.mjs";
2
+ import { BotSchema, NullableSinglePeopleIdSchema, NullableSinglePeopleSchema, PeopleIdSchema, PeopleSchema, PersonSchema, SinglePeopleIdSchema, SinglePeopleSchema, UserOrGroupIdSchema, UserOrGroupSchema, UserSchema } from "./people.mjs";
3
3
  import { CreatedByIdSchema, CreatedBySchema, NullableCreatedByNameSchema } from "./created-by.mjs";
4
4
  import { CreatedTimeSchema } from "./created-time.mjs";
5
5
  import { DateObjectSchema, FullDateSchema, NullableFullDateSchema, NullableRangeDateSchema, NullableSingleDateSchema, RangeDateSchema, SingleDateSchema } from "./date.mjs";
6
6
  import { EmailSchema, NullableEmailSchema } from "./email.mjs";
7
- import { FileArraySchema, NullableSingleFileSchema, SingleFileSchema } from "./file.mjs";
8
- import { FormulaSchema } from "./formula.mjs";
7
+ import { FileSchema, NullableSingleFileSchema, SingleFileSchema } from "./files.mjs";
8
+ import { BooleanFormulaSchema, FormulaSchema, NullableBooleanFormulaSchema, NullableStringFormulaSchema, StringFormulaSchema } from "./formula.mjs";
9
9
  import { LastEditedByIdSchema, LastEditedBySchema, NullableLastEditedByNameSchema } from "./last-edited-by.mjs";
10
10
  import { LastEditedTimeSchema } from "./last-edited-time.mjs";
11
11
  import { MultiSelectSchema } from "./multi-select.mjs";
@@ -13,11 +13,11 @@ import { NullableNumberSchema, NumberSchema } from "./number.mjs";
13
13
  import { NullablePhoneNumberSchema, PhoneNumberSchema } from "./phone-number.mjs";
14
14
  import { NullablePlaceSchema, PlaceSchema } from "./place.mjs";
15
15
  import { NullableSingleRelationSchema, RelationSchema, SingleRelationSchema } from "./relation.mjs";
16
- import { NullableRollupDateSchema, NullableRollupNumberSchema, NullableSingleRollupArraySchema, RollupArraySchema, RollupDateSchema, RollupNumberSchema, SingleRollupArraySchema } from "./rollup.mjs";
16
+ import { NullableRollupDateSchema, NullableRollupNumberSchema, NullableSingleRollupArraySchema, RollupArraySchema, RollupDateSchema, RollupNumberSchema, RollupSimpleSchema, SingleRollupArraySchema } from "./rollup.mjs";
17
17
  import { NullableSelectSchema, SelectSchema } from "./select.mjs";
18
18
  import { NullableStatusSchema, StatusSchema } from "./status.mjs";
19
19
  import { NullableRichTextSchema, NullableTitleSchema, RichTextSchema, TitleSchema } from "./text.mjs";
20
20
  import { NullableUniqueIdSchema, UniqueIdNumberSchema } from "./unique-id.mjs";
21
21
  import { NullableUrlSchema, UrlSchema } from "./url.mjs";
22
22
  import { NullableVerificationSchema, VerificationSchema } from "./verification.mjs";
23
- export { CheckboxSchema, CreatedByIdSchema, CreatedBySchema, CreatedTimeSchema, DateObjectSchema, EmailSchema, FileArraySchema, FormulaSchema, FullDateSchema, LastEditedByIdSchema, LastEditedBySchema, LastEditedTimeSchema, MultiSelectSchema, NullableCreatedByNameSchema, NullableEmailSchema, NullableFullDateSchema, NullableLastEditedByNameSchema, NullableNumberSchema, NullablePhoneNumberSchema, NullablePlaceSchema, NullableRangeDateSchema, NullableRichTextSchema, NullableRollupDateSchema, NullableRollupNumberSchema, NullableSelectSchema, NullableSingleDateSchema, NullableSingleFileSchema, NullableSingleRelationSchema, NullableSingleRollupArraySchema, NullableStatusSchema, NullableTitleSchema, NullableUniqueIdSchema, NullableUrlSchema, NullableVerificationSchema, NumberSchema, PeopleIdSchema, PeopleSchema, PersonSchema, PhoneNumberSchema, PlaceSchema, RangeDateSchema, RelationSchema, RichTextSchema, RollupArraySchema, RollupDateSchema, RollupNumberSchema, SelectSchema, SingleDateSchema, SingleFileSchema, SingleRelationSchema, SingleRollupArraySchema, StatusSchema, TitleSchema, UniqueIdNumberSchema, UrlSchema, VerificationSchema };
23
+ export { BooleanFormulaSchema, BotSchema, CheckboxSchema, CreatedByIdSchema, CreatedBySchema, CreatedTimeSchema, DateObjectSchema, EmailSchema, FileSchema, FormulaSchema, FullDateSchema, LastEditedByIdSchema, LastEditedBySchema, LastEditedTimeSchema, MultiSelectSchema, NullableBooleanFormulaSchema, NullableCreatedByNameSchema, NullableEmailSchema, NullableFullDateSchema, NullableLastEditedByNameSchema, NullableNumberSchema, NullablePhoneNumberSchema, NullablePlaceSchema, NullableRangeDateSchema, NullableRichTextSchema, NullableRollupDateSchema, NullableRollupNumberSchema, NullableSelectSchema, NullableSingleDateSchema, NullableSingleFileSchema, NullableSinglePeopleIdSchema, NullableSinglePeopleSchema, NullableSingleRelationSchema, NullableSingleRollupArraySchema, NullableStatusSchema, NullableStringFormulaSchema, NullableTitleSchema, NullableUniqueIdSchema, NullableUrlSchema, NullableVerificationSchema, NumberSchema, PeopleIdSchema, PeopleSchema, PersonSchema, PhoneNumberSchema, PlaceSchema, RangeDateSchema, RelationSchema, RichTextSchema, RollupArraySchema, RollupDateSchema, RollupNumberSchema, RollupSimpleSchema, SelectSchema, SingleDateSchema, SingleFileSchema, SinglePeopleIdSchema, SinglePeopleSchema, SingleRelationSchema, SingleRollupArraySchema, StatusSchema, StringFormulaSchema, TitleSchema, UniqueIdNumberSchema, UrlSchema, UserOrGroupIdSchema, UserOrGroupSchema, UserSchema, VerificationSchema };