@nakanoaas/notion-valibot-schema 0.0.3 → 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.
- package/README.md +26 -24
- package/dist/checkbox.cjs +29 -0
- package/dist/checkbox.cjs.map +1 -1
- package/dist/checkbox.d.cts +30 -0
- package/dist/checkbox.d.mts +30 -0
- package/dist/checkbox.mjs +29 -0
- package/dist/checkbox.mjs.map +1 -1
- package/dist/created-by.cjs +75 -0
- package/dist/created-by.cjs.map +1 -1
- package/dist/created-by.d.cts +76 -0
- package/dist/created-by.d.mts +76 -0
- package/dist/created-by.mjs +75 -0
- package/dist/created-by.mjs.map +1 -1
- package/dist/created-time.cjs +27 -0
- package/dist/created-time.cjs.map +1 -1
- package/dist/created-time.d.cts +28 -0
- package/dist/created-time.d.mts +28 -0
- package/dist/created-time.mjs +27 -0
- package/dist/created-time.mjs.map +1 -1
- package/dist/date.cjs +203 -13
- package/dist/date.cjs.map +1 -1
- package/dist/date.d.cts +214 -6
- package/dist/date.d.mts +214 -6
- package/dist/date.mjs +201 -12
- package/dist/date.mjs.map +1 -1
- package/dist/email.cjs +58 -0
- package/dist/email.cjs.map +1 -1
- package/dist/email.d.cts +59 -0
- package/dist/email.d.mts +59 -0
- package/dist/email.mjs +58 -0
- package/dist/email.mjs.map +1 -1
- package/dist/files.cjs +39 -0
- package/dist/files.cjs.map +1 -1
- package/dist/files.d.cts +40 -0
- package/dist/files.d.mts +40 -0
- package/dist/files.mjs +39 -0
- package/dist/files.mjs.map +1 -1
- package/dist/formula.cjs +72 -0
- package/dist/formula.cjs.map +1 -1
- package/dist/formula.d.cts +73 -0
- package/dist/formula.d.mts +73 -0
- package/dist/formula.mjs +72 -0
- package/dist/formula.mjs.map +1 -1
- package/dist/index.cjs +7 -3
- package/dist/index.d.cts +4 -4
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +4 -4
- package/dist/last-edited-by.cjs +68 -0
- package/dist/last-edited-by.cjs.map +1 -1
- package/dist/last-edited-by.d.cts +69 -0
- package/dist/last-edited-by.d.mts +69 -0
- package/dist/last-edited-by.mjs +68 -0
- package/dist/last-edited-by.mjs.map +1 -1
- package/dist/last-edited-time.cjs +27 -0
- package/dist/last-edited-time.cjs.map +1 -1
- package/dist/last-edited-time.d.cts +28 -0
- package/dist/last-edited-time.d.mts +28 -0
- package/dist/last-edited-time.mjs +27 -0
- package/dist/last-edited-time.mjs.map +1 -1
- package/dist/multi-select.cjs +60 -0
- package/dist/multi-select.cjs.map +1 -1
- package/dist/multi-select.d.cts +61 -0
- package/dist/multi-select.d.mts +61 -0
- package/dist/multi-select.mjs +60 -0
- package/dist/multi-select.mjs.map +1 -1
- package/dist/number.cjs +58 -0
- package/dist/number.cjs.map +1 -1
- package/dist/number.d.cts +59 -0
- package/dist/number.d.mts +59 -0
- package/dist/number.mjs +58 -0
- package/dist/number.mjs.map +1 -1
- package/dist/people.cjs +84 -0
- package/dist/people.cjs.map +1 -1
- package/dist/people.d.cts +85 -0
- package/dist/people.d.mts +85 -0
- package/dist/people.mjs +84 -0
- package/dist/people.mjs.map +1 -1
- package/dist/phone-number.cjs +58 -0
- package/dist/phone-number.cjs.map +1 -1
- package/dist/phone-number.d.cts +59 -0
- package/dist/phone-number.d.mts +59 -0
- package/dist/phone-number.mjs +58 -0
- package/dist/phone-number.mjs.map +1 -1
- package/dist/place.cjs +128 -0
- package/dist/place.cjs.map +1 -1
- package/dist/place.d.cts +85 -0
- package/dist/place.d.mts +85 -0
- package/dist/place.mjs +128 -0
- package/dist/place.mjs.map +1 -1
- package/dist/relation.cjs +137 -1
- package/dist/relation.cjs.map +1 -1
- package/dist/relation.d.cts +113 -1
- package/dist/relation.d.mts +113 -1
- package/dist/relation.mjs +136 -2
- package/dist/relation.mjs.map +1 -1
- package/dist/rollup.cjs +203 -10
- package/dist/rollup.cjs.map +1 -1
- package/dist/rollup.d.cts +201 -0
- package/dist/rollup.d.mts +201 -0
- package/dist/rollup.mjs +203 -10
- package/dist/rollup.mjs.map +1 -1
- package/dist/select.cjs +120 -0
- package/dist/select.cjs.map +1 -1
- package/dist/select.d.cts +121 -0
- package/dist/select.d.mts +121 -0
- package/dist/select.mjs +120 -0
- package/dist/select.mjs.map +1 -1
- package/dist/status.cjs +120 -0
- package/dist/status.cjs.map +1 -1
- package/dist/status.d.cts +121 -0
- package/dist/status.d.mts +121 -0
- package/dist/status.mjs +120 -0
- package/dist/status.mjs.map +1 -1
- package/dist/text.cjs +103 -3
- package/dist/text.cjs.map +1 -1
- package/dist/text.d.cts +73 -10
- package/dist/text.d.mts +73 -10
- package/dist/text.mjs +103 -3
- package/dist/text.mjs.map +1 -1
- package/dist/unique-id.cjs +73 -2
- package/dist/unique-id.cjs.map +1 -1
- package/dist/unique-id.d.cts +81 -2
- package/dist/unique-id.d.mts +81 -2
- package/dist/unique-id.mjs +72 -2
- package/dist/unique-id.mjs.map +1 -1
- package/dist/url.cjs +58 -0
- package/dist/url.cjs.map +1 -1
- package/dist/url.d.cts +59 -0
- package/dist/url.d.mts +59 -0
- package/dist/url.mjs +58 -0
- package/dist/url.mjs.map +1 -1
- package/dist/verification.cjs +82 -5
- package/dist/verification.cjs.map +1 -1
- package/dist/verification.d.cts +81 -0
- package/dist/verification.d.mts +81 -0
- package/dist/verification.mjs +82 -5
- package/dist/verification.mjs.map +1 -1
- package/package.json +1 -1
package/dist/rollup.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rollup.mjs","names":["v"],"sources":["../src/rollup.ts"],"sourcesContent":["import * as v from \"valibot\";\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(
|
|
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
|
}
|
package/dist/select.cjs.map
CHANGED
|
@@ -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":"
|
|
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"}
|
package/dist/select.d.cts
CHANGED
|
@@ -1,6 +1,67 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
2
|
|
|
3
3
|
//#region src/select.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Schema factory to extract the `select` property from a Notion page property.
|
|
7
|
+
*
|
|
8
|
+
* This is a generic schema factory that accepts another schema as a parameter,
|
|
9
|
+
* allowing you to combine it with other schemas in this library to extract
|
|
10
|
+
* typed select values. The select property in Notion contains an object with
|
|
11
|
+
* a `name` field that can be validated using the provided schema.
|
|
12
|
+
*
|
|
13
|
+
* **Input:**
|
|
14
|
+
* ```
|
|
15
|
+
* {
|
|
16
|
+
* select: {
|
|
17
|
+
* name: string;
|
|
18
|
+
* };
|
|
19
|
+
* }
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* **Output:** The output type depends on the schema passed as a parameter.
|
|
23
|
+
* For example, if `v.string()` is passed, the output will be `string`.
|
|
24
|
+
*
|
|
25
|
+
* @param schema - A schema that validates the select option name.
|
|
26
|
+
* Must accept a string value.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* import * as v from "valibot";
|
|
31
|
+
* import { SelectSchema } from "@nakanoaas/notion-valibot-utils";
|
|
32
|
+
*
|
|
33
|
+
* const PageSchema = v.object({
|
|
34
|
+
* id: v.string(),
|
|
35
|
+
* properties: v.object({
|
|
36
|
+
* Status: SelectSchema(v.string()),
|
|
37
|
+
* }),
|
|
38
|
+
* });
|
|
39
|
+
*
|
|
40
|
+
* const page = await notion.pages.retrieve({ page_id: "..." });
|
|
41
|
+
* const parsed = v.parse(PageSchema, page);
|
|
42
|
+
* // parsed.properties.Status: string
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* import * as v from "valibot";
|
|
48
|
+
* import { SelectSchema } from "@nakanoaas/notion-valibot-utils";
|
|
49
|
+
*
|
|
50
|
+
* // Custom schema for enum values
|
|
51
|
+
* const StatusSchema = v.picklist(["todo", "in-progress", "done"]);
|
|
52
|
+
*
|
|
53
|
+
* const PageSchema = v.object({
|
|
54
|
+
* id: v.string(),
|
|
55
|
+
* properties: v.object({
|
|
56
|
+
* Status: SelectSchema(StatusSchema),
|
|
57
|
+
* }),
|
|
58
|
+
* });
|
|
59
|
+
*
|
|
60
|
+
* const page = await notion.pages.retrieve({ page_id: "..." });
|
|
61
|
+
* const parsed = v.parse(PageSchema, page);
|
|
62
|
+
* // parsed.properties.Status: "todo" | "in-progress" | "done"
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
4
65
|
declare function SelectSchema<T extends v.GenericSchema<string>>(schema: T): v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
5
66
|
readonly select: v.ObjectSchema<{
|
|
6
67
|
readonly name: T;
|
|
@@ -32,6 +93,66 @@ declare function SelectSchema<T extends v.GenericSchema<string>>(schema: T): v.S
|
|
|
32
93
|
}, T 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 T["default"] ? "name" : never : never> & Partial<Pick<{
|
|
33
94
|
name: v.InferOutput<T>;
|
|
34
95
|
}, T 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 T["default"] ? "name" : never : never>>, Exclude<"name", T 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] ? "name" : never : never> | Exclude<T 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 T["default"] ? "name" : never : never, T 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] ? "name" : never : never> | Exclude<Exclude<"name", T 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 T["default"] ? "name" : never : never>, T 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] ? "name" : never : never>>)["name"]>]>;
|
|
96
|
+
/**
|
|
97
|
+
* Schema factory to extract the `select` property from a Notion page property or `null`.
|
|
98
|
+
*
|
|
99
|
+
* This is a generic schema factory that accepts another schema as a parameter,
|
|
100
|
+
* allowing you to combine it with other schemas in this library to extract
|
|
101
|
+
* typed select values. The select property in Notion contains an object with
|
|
102
|
+
* a `name` field that can be validated using the provided schema, or `null` if not set.
|
|
103
|
+
*
|
|
104
|
+
* **Input:**
|
|
105
|
+
* ```
|
|
106
|
+
* {
|
|
107
|
+
* select: {
|
|
108
|
+
* name: string;
|
|
109
|
+
* } | null;
|
|
110
|
+
* }
|
|
111
|
+
* ```
|
|
112
|
+
*
|
|
113
|
+
* **Output:** The output type depends on the schema passed as a parameter, or `null`.
|
|
114
|
+
* For example, if `v.string()` is passed, the output will be `string | null`.
|
|
115
|
+
*
|
|
116
|
+
* @param schema - A schema that validates the select option name.
|
|
117
|
+
* Must accept a string value.
|
|
118
|
+
*
|
|
119
|
+
* @example
|
|
120
|
+
* ```ts
|
|
121
|
+
* import * as v from "valibot";
|
|
122
|
+
* import { NullableSelectSchema } from "@nakanoaas/notion-valibot-utils";
|
|
123
|
+
*
|
|
124
|
+
* const PageSchema = v.object({
|
|
125
|
+
* id: v.string(),
|
|
126
|
+
* properties: v.object({
|
|
127
|
+
* Status: NullableSelectSchema(v.string()),
|
|
128
|
+
* }),
|
|
129
|
+
* });
|
|
130
|
+
*
|
|
131
|
+
* const page = await notion.pages.retrieve({ page_id: "..." });
|
|
132
|
+
* const parsed = v.parse(PageSchema, page);
|
|
133
|
+
* // parsed.properties.Status: string | null
|
|
134
|
+
* ```
|
|
135
|
+
*
|
|
136
|
+
* @example
|
|
137
|
+
* ```ts
|
|
138
|
+
* import * as v from "valibot";
|
|
139
|
+
* import { NullableSelectSchema } from "@nakanoaas/notion-valibot-utils";
|
|
140
|
+
*
|
|
141
|
+
* // Custom schema for enum values
|
|
142
|
+
* const StatusSchema = v.picklist(["todo", "in-progress", "done"]);
|
|
143
|
+
*
|
|
144
|
+
* const PageSchema = v.object({
|
|
145
|
+
* id: v.string(),
|
|
146
|
+
* properties: v.object({
|
|
147
|
+
* Status: NullableSelectSchema(StatusSchema),
|
|
148
|
+
* }),
|
|
149
|
+
* });
|
|
150
|
+
*
|
|
151
|
+
* const page = await notion.pages.retrieve({ page_id: "..." });
|
|
152
|
+
* const parsed = v.parse(PageSchema, page);
|
|
153
|
+
* // parsed.properties.Status: "todo" | "in-progress" | "done" | null
|
|
154
|
+
* ```
|
|
155
|
+
*/
|
|
35
156
|
declare function NullableSelectSchema<T extends v.GenericSchema<string>>(schema: T): v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
36
157
|
readonly select: v.NullableSchema<v.ObjectSchema<{
|
|
37
158
|
readonly name: T;
|
package/dist/select.d.mts
CHANGED
|
@@ -1,6 +1,67 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
2
|
|
|
3
3
|
//#region src/select.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Schema factory to extract the `select` property from a Notion page property.
|
|
7
|
+
*
|
|
8
|
+
* This is a generic schema factory that accepts another schema as a parameter,
|
|
9
|
+
* allowing you to combine it with other schemas in this library to extract
|
|
10
|
+
* typed select values. The select property in Notion contains an object with
|
|
11
|
+
* a `name` field that can be validated using the provided schema.
|
|
12
|
+
*
|
|
13
|
+
* **Input:**
|
|
14
|
+
* ```
|
|
15
|
+
* {
|
|
16
|
+
* select: {
|
|
17
|
+
* name: string;
|
|
18
|
+
* };
|
|
19
|
+
* }
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* **Output:** The output type depends on the schema passed as a parameter.
|
|
23
|
+
* For example, if `v.string()` is passed, the output will be `string`.
|
|
24
|
+
*
|
|
25
|
+
* @param schema - A schema that validates the select option name.
|
|
26
|
+
* Must accept a string value.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* import * as v from "valibot";
|
|
31
|
+
* import { SelectSchema } from "@nakanoaas/notion-valibot-utils";
|
|
32
|
+
*
|
|
33
|
+
* const PageSchema = v.object({
|
|
34
|
+
* id: v.string(),
|
|
35
|
+
* properties: v.object({
|
|
36
|
+
* Status: SelectSchema(v.string()),
|
|
37
|
+
* }),
|
|
38
|
+
* });
|
|
39
|
+
*
|
|
40
|
+
* const page = await notion.pages.retrieve({ page_id: "..." });
|
|
41
|
+
* const parsed = v.parse(PageSchema, page);
|
|
42
|
+
* // parsed.properties.Status: string
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* import * as v from "valibot";
|
|
48
|
+
* import { SelectSchema } from "@nakanoaas/notion-valibot-utils";
|
|
49
|
+
*
|
|
50
|
+
* // Custom schema for enum values
|
|
51
|
+
* const StatusSchema = v.picklist(["todo", "in-progress", "done"]);
|
|
52
|
+
*
|
|
53
|
+
* const PageSchema = v.object({
|
|
54
|
+
* id: v.string(),
|
|
55
|
+
* properties: v.object({
|
|
56
|
+
* Status: SelectSchema(StatusSchema),
|
|
57
|
+
* }),
|
|
58
|
+
* });
|
|
59
|
+
*
|
|
60
|
+
* const page = await notion.pages.retrieve({ page_id: "..." });
|
|
61
|
+
* const parsed = v.parse(PageSchema, page);
|
|
62
|
+
* // parsed.properties.Status: "todo" | "in-progress" | "done"
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
4
65
|
declare function SelectSchema<T extends v.GenericSchema<string>>(schema: T): v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
5
66
|
readonly select: v.ObjectSchema<{
|
|
6
67
|
readonly name: T;
|
|
@@ -32,6 +93,66 @@ declare function SelectSchema<T extends v.GenericSchema<string>>(schema: T): v.S
|
|
|
32
93
|
}, T 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 T["default"] ? "name" : never : never> & Partial<Pick<{
|
|
33
94
|
name: v.InferOutput<T>;
|
|
34
95
|
}, T 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 T["default"] ? "name" : never : never>>, Exclude<"name", T 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] ? "name" : never : never> | Exclude<T 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 T["default"] ? "name" : never : never, T 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] ? "name" : never : never> | Exclude<Exclude<"name", T 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 T["default"] ? "name" : never : never>, T 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] ? "name" : never : never>>)["name"]>]>;
|
|
96
|
+
/**
|
|
97
|
+
* Schema factory to extract the `select` property from a Notion page property or `null`.
|
|
98
|
+
*
|
|
99
|
+
* This is a generic schema factory that accepts another schema as a parameter,
|
|
100
|
+
* allowing you to combine it with other schemas in this library to extract
|
|
101
|
+
* typed select values. The select property in Notion contains an object with
|
|
102
|
+
* a `name` field that can be validated using the provided schema, or `null` if not set.
|
|
103
|
+
*
|
|
104
|
+
* **Input:**
|
|
105
|
+
* ```
|
|
106
|
+
* {
|
|
107
|
+
* select: {
|
|
108
|
+
* name: string;
|
|
109
|
+
* } | null;
|
|
110
|
+
* }
|
|
111
|
+
* ```
|
|
112
|
+
*
|
|
113
|
+
* **Output:** The output type depends on the schema passed as a parameter, or `null`.
|
|
114
|
+
* For example, if `v.string()` is passed, the output will be `string | null`.
|
|
115
|
+
*
|
|
116
|
+
* @param schema - A schema that validates the select option name.
|
|
117
|
+
* Must accept a string value.
|
|
118
|
+
*
|
|
119
|
+
* @example
|
|
120
|
+
* ```ts
|
|
121
|
+
* import * as v from "valibot";
|
|
122
|
+
* import { NullableSelectSchema } from "@nakanoaas/notion-valibot-utils";
|
|
123
|
+
*
|
|
124
|
+
* const PageSchema = v.object({
|
|
125
|
+
* id: v.string(),
|
|
126
|
+
* properties: v.object({
|
|
127
|
+
* Status: NullableSelectSchema(v.string()),
|
|
128
|
+
* }),
|
|
129
|
+
* });
|
|
130
|
+
*
|
|
131
|
+
* const page = await notion.pages.retrieve({ page_id: "..." });
|
|
132
|
+
* const parsed = v.parse(PageSchema, page);
|
|
133
|
+
* // parsed.properties.Status: string | null
|
|
134
|
+
* ```
|
|
135
|
+
*
|
|
136
|
+
* @example
|
|
137
|
+
* ```ts
|
|
138
|
+
* import * as v from "valibot";
|
|
139
|
+
* import { NullableSelectSchema } from "@nakanoaas/notion-valibot-utils";
|
|
140
|
+
*
|
|
141
|
+
* // Custom schema for enum values
|
|
142
|
+
* const StatusSchema = v.picklist(["todo", "in-progress", "done"]);
|
|
143
|
+
*
|
|
144
|
+
* const PageSchema = v.object({
|
|
145
|
+
* id: v.string(),
|
|
146
|
+
* properties: v.object({
|
|
147
|
+
* Status: NullableSelectSchema(StatusSchema),
|
|
148
|
+
* }),
|
|
149
|
+
* });
|
|
150
|
+
*
|
|
151
|
+
* const page = await notion.pages.retrieve({ page_id: "..." });
|
|
152
|
+
* const parsed = v.parse(PageSchema, page);
|
|
153
|
+
* // parsed.properties.Status: "todo" | "in-progress" | "done" | null
|
|
154
|
+
* ```
|
|
155
|
+
*/
|
|
35
156
|
declare function NullableSelectSchema<T extends v.GenericSchema<string>>(schema: T): v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
36
157
|
readonly select: v.NullableSchema<v.ObjectSchema<{
|
|
37
158
|
readonly name: T;
|
package/dist/select.mjs
CHANGED
|
@@ -1,9 +1,129 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
2
|
|
|
3
3
|
//#region src/select.ts
|
|
4
|
+
/**
|
|
5
|
+
* Schema factory to extract the `select` property from a Notion page property.
|
|
6
|
+
*
|
|
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 select values. The select property in Notion contains an object with
|
|
10
|
+
* a `name` field that can be validated using the provided schema.
|
|
11
|
+
*
|
|
12
|
+
* **Input:**
|
|
13
|
+
* ```
|
|
14
|
+
* {
|
|
15
|
+
* select: {
|
|
16
|
+
* name: string;
|
|
17
|
+
* };
|
|
18
|
+
* }
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* **Output:** The output type depends on the schema passed as a parameter.
|
|
22
|
+
* For example, if `v.string()` is passed, the output will be `string`.
|
|
23
|
+
*
|
|
24
|
+
* @param schema - A schema that validates the select option name.
|
|
25
|
+
* Must accept a string value.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* import * as v from "valibot";
|
|
30
|
+
* import { SelectSchema } from "@nakanoaas/notion-valibot-utils";
|
|
31
|
+
*
|
|
32
|
+
* const PageSchema = v.object({
|
|
33
|
+
* id: v.string(),
|
|
34
|
+
* properties: v.object({
|
|
35
|
+
* Status: SelectSchema(v.string()),
|
|
36
|
+
* }),
|
|
37
|
+
* });
|
|
38
|
+
*
|
|
39
|
+
* const page = await notion.pages.retrieve({ page_id: "..." });
|
|
40
|
+
* const parsed = v.parse(PageSchema, page);
|
|
41
|
+
* // parsed.properties.Status: string
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* import * as v from "valibot";
|
|
47
|
+
* import { SelectSchema } from "@nakanoaas/notion-valibot-utils";
|
|
48
|
+
*
|
|
49
|
+
* // Custom schema for enum values
|
|
50
|
+
* const StatusSchema = v.picklist(["todo", "in-progress", "done"]);
|
|
51
|
+
*
|
|
52
|
+
* const PageSchema = v.object({
|
|
53
|
+
* id: v.string(),
|
|
54
|
+
* properties: v.object({
|
|
55
|
+
* Status: SelectSchema(StatusSchema),
|
|
56
|
+
* }),
|
|
57
|
+
* });
|
|
58
|
+
*
|
|
59
|
+
* const page = await notion.pages.retrieve({ page_id: "..." });
|
|
60
|
+
* const parsed = v.parse(PageSchema, page);
|
|
61
|
+
* // parsed.properties.Status: "todo" | "in-progress" | "done"
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
4
64
|
function SelectSchema(schema) {
|
|
5
65
|
return v.pipe(v.object({ select: v.object({ name: schema }) }), v.transform((v$1) => v$1.select.name));
|
|
6
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* Schema factory to extract the `select` property from a Notion page property or `null`.
|
|
69
|
+
*
|
|
70
|
+
* This is a generic schema factory that accepts another schema as a parameter,
|
|
71
|
+
* allowing you to combine it with other schemas in this library to extract
|
|
72
|
+
* typed select values. The select property in Notion contains an object with
|
|
73
|
+
* a `name` field that can be validated using the provided schema, or `null` if not set.
|
|
74
|
+
*
|
|
75
|
+
* **Input:**
|
|
76
|
+
* ```
|
|
77
|
+
* {
|
|
78
|
+
* select: {
|
|
79
|
+
* name: string;
|
|
80
|
+
* } | null;
|
|
81
|
+
* }
|
|
82
|
+
* ```
|
|
83
|
+
*
|
|
84
|
+
* **Output:** The output type depends on the schema passed as a parameter, or `null`.
|
|
85
|
+
* For example, if `v.string()` is passed, the output will be `string | null`.
|
|
86
|
+
*
|
|
87
|
+
* @param schema - A schema that validates the select option name.
|
|
88
|
+
* Must accept a string value.
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* ```ts
|
|
92
|
+
* import * as v from "valibot";
|
|
93
|
+
* import { NullableSelectSchema } from "@nakanoaas/notion-valibot-utils";
|
|
94
|
+
*
|
|
95
|
+
* const PageSchema = v.object({
|
|
96
|
+
* id: v.string(),
|
|
97
|
+
* properties: v.object({
|
|
98
|
+
* Status: NullableSelectSchema(v.string()),
|
|
99
|
+
* }),
|
|
100
|
+
* });
|
|
101
|
+
*
|
|
102
|
+
* const page = await notion.pages.retrieve({ page_id: "..." });
|
|
103
|
+
* const parsed = v.parse(PageSchema, page);
|
|
104
|
+
* // parsed.properties.Status: string | null
|
|
105
|
+
* ```
|
|
106
|
+
*
|
|
107
|
+
* @example
|
|
108
|
+
* ```ts
|
|
109
|
+
* import * as v from "valibot";
|
|
110
|
+
* import { NullableSelectSchema } from "@nakanoaas/notion-valibot-utils";
|
|
111
|
+
*
|
|
112
|
+
* // Custom schema for enum values
|
|
113
|
+
* const StatusSchema = v.picklist(["todo", "in-progress", "done"]);
|
|
114
|
+
*
|
|
115
|
+
* const PageSchema = v.object({
|
|
116
|
+
* id: v.string(),
|
|
117
|
+
* properties: v.object({
|
|
118
|
+
* Status: NullableSelectSchema(StatusSchema),
|
|
119
|
+
* }),
|
|
120
|
+
* });
|
|
121
|
+
*
|
|
122
|
+
* const page = await notion.pages.retrieve({ page_id: "..." });
|
|
123
|
+
* const parsed = v.parse(PageSchema, page);
|
|
124
|
+
* // parsed.properties.Status: "todo" | "in-progress" | "done" | null
|
|
125
|
+
* ```
|
|
126
|
+
*/
|
|
7
127
|
function NullableSelectSchema(schema) {
|
|
8
128
|
return v.pipe(v.object({ select: v.nullable(v.object({ name: schema })) }), v.transform((v$1) => v$1.select?.name ?? null));
|
|
9
129
|
}
|
package/dist/select.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.mjs","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":"
|
|
1
|
+
{"version":3,"file":"select.mjs","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,QAAO,EAAE,KACR,EAAE,OAAO,EACR,QAAQ,EAAE,OAAO,EAChB,MAAM,QACN,CAAC,EACF,CAAC,EAEF,EAAE,WAAW,QAAMA,IAAE,OAAO,KAAM,CAClC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+DF,SAAgB,qBACf,QACC;AACD,QAAO,EAAE,KACR,EAAE,OAAO,EACR,QAAQ,EAAE,SACT,EAAE,OAAO,EACR,MAAM,QACN,CAAC,CACF,EACD,CAAC,EACF,EAAE,WAAW,QAAMA,IAAE,QAAQ,QAAQ,KAAK,CAC1C"}
|