@nakanoaas/notion-valibot-schema 0.2.2 → 0.3.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.
- package/README.md +2 -1
- package/dist/_virtual/_rolldown/runtime.cjs +7 -13
- package/dist/checkbox.cjs +3 -4
- package/dist/checkbox.cjs.map +1 -1
- package/dist/checkbox.mjs +1 -2
- package/dist/checkbox.mjs.map +1 -1
- package/dist/created-by.cjs +4 -5
- package/dist/created-by.cjs.map +1 -1
- package/dist/created-by.mjs +1 -2
- package/dist/created-by.mjs.map +1 -1
- package/dist/created-time.cjs +3 -4
- package/dist/created-time.cjs.map +1 -1
- package/dist/created-time.mjs +1 -2
- package/dist/created-time.mjs.map +1 -1
- package/dist/date.cjs +3 -4
- package/dist/date.cjs.map +1 -1
- package/dist/date.mjs +1 -2
- package/dist/date.mjs.map +1 -1
- package/dist/email.cjs +3 -4
- package/dist/email.cjs.map +1 -1
- package/dist/email.mjs +1 -2
- package/dist/email.mjs.map +1 -1
- package/dist/file.cjs +164 -0
- package/dist/file.cjs.map +1 -0
- package/dist/file.d.cts +198 -0
- package/dist/file.d.mts +198 -0
- package/dist/file.mjs +160 -0
- package/dist/file.mjs.map +1 -0
- package/dist/formula.cjs +3 -4
- package/dist/formula.cjs.map +1 -1
- package/dist/formula.mjs +1 -2
- package/dist/formula.mjs.map +1 -1
- package/dist/index.cjs +27 -26
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +2 -3
- package/dist/last-edited-by.cjs +4 -5
- package/dist/last-edited-by.cjs.map +1 -1
- package/dist/last-edited-by.mjs +1 -2
- package/dist/last-edited-by.mjs.map +1 -1
- package/dist/last-edited-time.cjs +3 -4
- package/dist/last-edited-time.cjs.map +1 -1
- package/dist/last-edited-time.mjs +1 -2
- package/dist/last-edited-time.mjs.map +1 -1
- package/dist/multi-select.cjs +3 -4
- package/dist/multi-select.cjs.map +1 -1
- package/dist/multi-select.mjs +1 -2
- package/dist/multi-select.mjs.map +1 -1
- package/dist/number.cjs +3 -4
- package/dist/number.cjs.map +1 -1
- package/dist/number.mjs +1 -2
- package/dist/number.mjs.map +1 -1
- package/dist/people.cjs +3 -4
- package/dist/people.cjs.map +1 -1
- package/dist/people.mjs +1 -2
- package/dist/people.mjs.map +1 -1
- package/dist/phone-number.cjs +3 -4
- package/dist/phone-number.cjs.map +1 -1
- package/dist/phone-number.mjs +1 -2
- package/dist/phone-number.mjs.map +1 -1
- package/dist/place.cjs +3 -4
- package/dist/place.cjs.map +1 -1
- package/dist/place.mjs +1 -2
- package/dist/place.mjs.map +1 -1
- package/dist/relation.cjs +3 -4
- package/dist/relation.cjs.map +1 -1
- package/dist/relation.mjs +1 -2
- package/dist/relation.mjs.map +1 -1
- package/dist/rollup.cjs +4 -5
- package/dist/rollup.cjs.map +1 -1
- package/dist/rollup.mjs +1 -2
- package/dist/rollup.mjs.map +1 -1
- package/dist/select.cjs +3 -4
- package/dist/select.cjs.map +1 -1
- package/dist/select.mjs +1 -2
- package/dist/select.mjs.map +1 -1
- package/dist/status.cjs +3 -4
- package/dist/status.cjs.map +1 -1
- package/dist/status.mjs +1 -2
- package/dist/status.mjs.map +1 -1
- package/dist/text.cjs +3 -4
- package/dist/text.cjs.map +1 -1
- package/dist/text.mjs +1 -2
- package/dist/text.mjs.map +1 -1
- package/dist/unique-id.cjs +3 -4
- package/dist/unique-id.cjs.map +1 -1
- package/dist/unique-id.mjs +1 -2
- package/dist/unique-id.mjs.map +1 -1
- package/dist/url.cjs +3 -4
- package/dist/url.cjs.map +1 -1
- package/dist/url.mjs +1 -2
- package/dist/url.mjs.map +1 -1
- package/dist/verification.cjs +5 -6
- package/dist/verification.cjs.map +1 -1
- package/dist/verification.mjs +1 -2
- package/dist/verification.mjs.map +1 -1
- package/package.json +2 -2
- package/dist/files.cjs +0 -55
- package/dist/files.cjs.map +0 -1
- package/dist/files.d.cts +0 -70
- package/dist/files.d.mts +0 -70
- package/dist/files.mjs +0 -53
- package/dist/files.mjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,34 +1,33 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value:
|
|
2
|
-
const require_checkbox = require(
|
|
3
|
-
const require_people = require(
|
|
4
|
-
const require_created_by = require(
|
|
5
|
-
const require_created_time = require(
|
|
6
|
-
const require_date = require(
|
|
7
|
-
const require_email = require(
|
|
8
|
-
const
|
|
9
|
-
const require_formula = require(
|
|
10
|
-
const require_last_edited_by = require(
|
|
11
|
-
const require_last_edited_time = require(
|
|
12
|
-
const require_multi_select = require(
|
|
13
|
-
const require_number = require(
|
|
14
|
-
const require_phone_number = require(
|
|
15
|
-
const require_place = require(
|
|
16
|
-
const require_relation = require(
|
|
17
|
-
const require_rollup = require(
|
|
18
|
-
const require_select = require(
|
|
19
|
-
const require_status = require(
|
|
20
|
-
const require_text = require(
|
|
21
|
-
const require_unique_id = require(
|
|
22
|
-
const require_url = require(
|
|
23
|
-
const require_verification = require(
|
|
24
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_checkbox = require("./checkbox.cjs");
|
|
3
|
+
const require_people = require("./people.cjs");
|
|
4
|
+
const require_created_by = require("./created-by.cjs");
|
|
5
|
+
const require_created_time = require("./created-time.cjs");
|
|
6
|
+
const require_date = require("./date.cjs");
|
|
7
|
+
const require_email = require("./email.cjs");
|
|
8
|
+
const require_file = require("./file.cjs");
|
|
9
|
+
const require_formula = require("./formula.cjs");
|
|
10
|
+
const require_last_edited_by = require("./last-edited-by.cjs");
|
|
11
|
+
const require_last_edited_time = require("./last-edited-time.cjs");
|
|
12
|
+
const require_multi_select = require("./multi-select.cjs");
|
|
13
|
+
const require_number = require("./number.cjs");
|
|
14
|
+
const require_phone_number = require("./phone-number.cjs");
|
|
15
|
+
const require_place = require("./place.cjs");
|
|
16
|
+
const require_relation = require("./relation.cjs");
|
|
17
|
+
const require_rollup = require("./rollup.cjs");
|
|
18
|
+
const require_select = require("./select.cjs");
|
|
19
|
+
const require_status = require("./status.cjs");
|
|
20
|
+
const require_text = require("./text.cjs");
|
|
21
|
+
const require_unique_id = require("./unique-id.cjs");
|
|
22
|
+
const require_url = require("./url.cjs");
|
|
23
|
+
const require_verification = require("./verification.cjs");
|
|
25
24
|
exports.CheckboxSchema = require_checkbox.CheckboxSchema;
|
|
26
25
|
exports.CreatedByIdSchema = require_created_by.CreatedByIdSchema;
|
|
27
26
|
exports.CreatedBySchema = require_created_by.CreatedBySchema;
|
|
28
27
|
exports.CreatedTimeSchema = require_created_time.CreatedTimeSchema;
|
|
29
28
|
exports.DateObjectSchema = require_date.DateObjectSchema;
|
|
30
29
|
exports.EmailSchema = require_email.EmailSchema;
|
|
31
|
-
exports.
|
|
30
|
+
exports.FileArraySchema = require_file.FileArraySchema;
|
|
32
31
|
exports.FormulaSchema = require_formula.FormulaSchema;
|
|
33
32
|
exports.FullDateSchema = require_date.FullDateSchema;
|
|
34
33
|
exports.LastEditedByIdSchema = require_last_edited_by.LastEditedByIdSchema;
|
|
@@ -48,6 +47,7 @@ exports.NullableRollupDateSchema = require_rollup.NullableRollupDateSchema;
|
|
|
48
47
|
exports.NullableRollupNumberSchema = require_rollup.NullableRollupNumberSchema;
|
|
49
48
|
exports.NullableSelectSchema = require_select.NullableSelectSchema;
|
|
50
49
|
exports.NullableSingleDateSchema = require_date.NullableSingleDateSchema;
|
|
50
|
+
exports.NullableSingleFileSchema = require_file.NullableSingleFileSchema;
|
|
51
51
|
exports.NullableSingleRelationSchema = require_relation.NullableSingleRelationSchema;
|
|
52
52
|
exports.NullableSingleRollupArraySchema = require_rollup.NullableSingleRollupArraySchema;
|
|
53
53
|
exports.NullableStatusSchema = require_status.NullableStatusSchema;
|
|
@@ -69,10 +69,11 @@ exports.RollupDateSchema = require_rollup.RollupDateSchema;
|
|
|
69
69
|
exports.RollupNumberSchema = require_rollup.RollupNumberSchema;
|
|
70
70
|
exports.SelectSchema = require_select.SelectSchema;
|
|
71
71
|
exports.SingleDateSchema = require_date.SingleDateSchema;
|
|
72
|
+
exports.SingleFileSchema = require_file.SingleFileSchema;
|
|
72
73
|
exports.SingleRelationSchema = require_relation.SingleRelationSchema;
|
|
73
74
|
exports.SingleRollupArraySchema = require_rollup.SingleRollupArraySchema;
|
|
74
75
|
exports.StatusSchema = require_status.StatusSchema;
|
|
75
76
|
exports.TitleSchema = require_text.TitleSchema;
|
|
76
77
|
exports.UniqueIdNumberSchema = require_unique_id.UniqueIdNumberSchema;
|
|
77
78
|
exports.UrlSchema = require_url.UrlSchema;
|
|
78
|
-
exports.VerificationSchema = require_verification.VerificationSchema;
|
|
79
|
+
exports.VerificationSchema = require_verification.VerificationSchema;
|
package/dist/index.d.cts
CHANGED
|
@@ -3,7 +3,7 @@ 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 {
|
|
6
|
+
import { FileArraySchema, NullableSingleFileSchema, SingleFileSchema } from "./file.cjs";
|
|
7
7
|
import { FormulaSchema } from "./formula.cjs";
|
|
8
8
|
import { LastEditedByIdSchema, LastEditedBySchema, NullableLastEditedByNameSchema } from "./last-edited-by.cjs";
|
|
9
9
|
import { LastEditedTimeSchema } from "./last-edited-time.cjs";
|
|
@@ -20,4 +20,4 @@ import { NullableRichTextSchema, NullableTitleSchema, RichTextSchema, TitleSchem
|
|
|
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,
|
|
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 };
|
package/dist/index.d.mts
CHANGED
|
@@ -3,7 +3,7 @@ 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 {
|
|
6
|
+
import { FileArraySchema, NullableSingleFileSchema, SingleFileSchema } from "./file.mjs";
|
|
7
7
|
import { FormulaSchema } from "./formula.mjs";
|
|
8
8
|
import { LastEditedByIdSchema, LastEditedBySchema, NullableLastEditedByNameSchema } from "./last-edited-by.mjs";
|
|
9
9
|
import { LastEditedTimeSchema } from "./last-edited-time.mjs";
|
|
@@ -20,4 +20,4 @@ import { NullableRichTextSchema, NullableTitleSchema, RichTextSchema, TitleSchem
|
|
|
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,
|
|
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 };
|
package/dist/index.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { CreatedByIdSchema, CreatedBySchema, NullableCreatedByNameSchema } from
|
|
|
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 {
|
|
7
|
+
import { FileArraySchema, NullableSingleFileSchema, SingleFileSchema } from "./file.mjs";
|
|
8
8
|
import { FormulaSchema } from "./formula.mjs";
|
|
9
9
|
import { LastEditedByIdSchema, LastEditedBySchema, NullableLastEditedByNameSchema } from "./last-edited-by.mjs";
|
|
10
10
|
import { LastEditedTimeSchema } from "./last-edited-time.mjs";
|
|
@@ -20,5 +20,4 @@ import { NullableRichTextSchema, NullableTitleSchema, RichTextSchema, TitleSchem
|
|
|
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
|
-
|
|
24
|
-
export { CheckboxSchema, CreatedByIdSchema, CreatedBySchema, CreatedTimeSchema, DateObjectSchema, EmailSchema, FilesSchema, FormulaSchema, FullDateSchema, LastEditedByIdSchema, LastEditedBySchema, LastEditedTimeSchema, MultiSelectSchema, NullableCreatedByNameSchema, NullableEmailSchema, NullableFullDateSchema, NullableLastEditedByNameSchema, NullableNumberSchema, NullablePhoneNumberSchema, NullablePlaceSchema, NullableRangeDateSchema, NullableRichTextSchema, NullableRollupDateSchema, NullableRollupNumberSchema, NullableSelectSchema, NullableSingleDateSchema, NullableSingleRelationSchema, NullableSingleRollupArraySchema, NullableStatusSchema, NullableTitleSchema, NullableUniqueIdSchema, NullableUrlSchema, NullableVerificationSchema, NumberSchema, PeopleIdSchema, PeopleSchema, PersonSchema, PhoneNumberSchema, PlaceSchema, RangeDateSchema, RelationSchema, RichTextSchema, RollupArraySchema, RollupDateSchema, RollupNumberSchema, SelectSchema, SingleDateSchema, SingleRelationSchema, SingleRollupArraySchema, StatusSchema, TitleSchema, UniqueIdNumberSchema, UrlSchema, VerificationSchema };
|
|
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 };
|
package/dist/last-edited-by.cjs
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
const require_runtime = require(
|
|
2
|
-
const require_people = require(
|
|
1
|
+
const require_runtime = require("./_virtual/_rolldown/runtime.cjs");
|
|
2
|
+
const require_people = require("./people.cjs");
|
|
3
3
|
let valibot = require("valibot");
|
|
4
|
-
valibot = require_runtime.__toESM(valibot);
|
|
5
|
-
|
|
4
|
+
valibot = require_runtime.__toESM(valibot, 1);
|
|
6
5
|
//#region src/last-edited-by.ts
|
|
7
6
|
/**
|
|
8
7
|
* Schema to extract the `last_edited_by` person object from a Notion page.
|
|
@@ -116,9 +115,9 @@ const NullableLastEditedByNameSchema = valibot.pipe(valibot.object({ last_edited
|
|
|
116
115
|
* ```
|
|
117
116
|
*/
|
|
118
117
|
const LastEditedByIdSchema = valibot.pipe(valibot.object({ last_edited_by: require_people.PersonSchema }), valibot.transform((v) => v.last_edited_by.id));
|
|
119
|
-
|
|
120
118
|
//#endregion
|
|
121
119
|
exports.LastEditedByIdSchema = LastEditedByIdSchema;
|
|
122
120
|
exports.LastEditedBySchema = LastEditedBySchema;
|
|
123
121
|
exports.NullableLastEditedByNameSchema = NullableLastEditedByNameSchema;
|
|
122
|
+
|
|
124
123
|
//# sourceMappingURL=last-edited-by.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"last-edited-by.cjs","names":["v","PersonSchema"],"sources":["../src/last-edited-by.ts"],"sourcesContent":["import * as v from \"valibot\";\n\nimport { PersonSchema } from \"./people\";\n\n/**\n * Schema to extract the `last_edited_by` person object from a Notion page.\n *\n * **Input:**\n * ```\n * {\n * last_edited_by: {\n * id: string;\n * object: \"user\" | \"bot\" | \"group\";\n * name: string | null;\n * ...\n * }\n * }\n * ```\n *\n * **Output:**\n * ```\n * {\n * id: string;\n * object: \"user\" | \"bot\" | \"group\";\n * name: string | null;\n * }\n * ```\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { LastEditedBySchema } from \"@nakanoaas/notion-valibot-schema\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * LastEditedBy: LastEditedBySchema,\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.LastEditedBy: { id: string; object: \"user\" | \"bot\" | \"group\"; name: string | null }\n * ```\n */\nexport const LastEditedBySchema = v.pipe(\n\tv.object({\n\t\tlast_edited_by: PersonSchema,\n\t}),\n\tv.transform((v) => v.last_edited_by),\n);\n\n/**\n * Schema to extract the `last_edited_by` person name from a Notion page.\n *\n * **Input:**\n * ```\n * {\n * last_edited_by: {\n * id: string;\n * object: \"user\" | \"bot\" | \"group\";\n * name: string | null;\n * ...\n * }\n * }\n * ```\n *\n * **Output:** `string | null`\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { NullableLastEditedByNameSchema } from \"@nakanoaas/notion-valibot-schema\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * LastEditedByName: NullableLastEditedByNameSchema,\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.LastEditedByName: string | null\n * ```\n */\nexport const NullableLastEditedByNameSchema = v.pipe(\n\tv.object({\n\t\tlast_edited_by: PersonSchema,\n\t}),\n\tv.transform((v) => v.last_edited_by.name),\n);\n\n/**\n * Schema to extract the `last_edited_by` person ID from a Notion page.\n *\n * **Input:**\n * ```\n * {\n * last_edited_by: {\n * id: string;\n * object: \"user\" | \"bot\" | \"group\";\n * name: string | null;\n * ...\n * }\n * }\n * ```\n *\n * **Output:** `string`\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { LastEditedByIdSchema } from \"@nakanoaas/notion-valibot-schema\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * LastEditedById: LastEditedByIdSchema,\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.LastEditedById: string\n * ```\n */\nexport const LastEditedByIdSchema = v.pipe(\n\tv.object({\n\t\tlast_edited_by: PersonSchema,\n\t}),\n\tv.transform((v) => v.last_edited_by.id),\n);\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"last-edited-by.cjs","names":["v","PersonSchema"],"sources":["../src/last-edited-by.ts"],"sourcesContent":["import * as v from \"valibot\";\n\nimport { PersonSchema } from \"./people\";\n\n/**\n * Schema to extract the `last_edited_by` person object from a Notion page.\n *\n * **Input:**\n * ```\n * {\n * last_edited_by: {\n * id: string;\n * object: \"user\" | \"bot\" | \"group\";\n * name: string | null;\n * ...\n * }\n * }\n * ```\n *\n * **Output:**\n * ```\n * {\n * id: string;\n * object: \"user\" | \"bot\" | \"group\";\n * name: string | null;\n * }\n * ```\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { LastEditedBySchema } from \"@nakanoaas/notion-valibot-schema\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * LastEditedBy: LastEditedBySchema,\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.LastEditedBy: { id: string; object: \"user\" | \"bot\" | \"group\"; name: string | null }\n * ```\n */\nexport const LastEditedBySchema = v.pipe(\n\tv.object({\n\t\tlast_edited_by: PersonSchema,\n\t}),\n\tv.transform((v) => v.last_edited_by),\n);\n\n/**\n * Schema to extract the `last_edited_by` person name from a Notion page.\n *\n * **Input:**\n * ```\n * {\n * last_edited_by: {\n * id: string;\n * object: \"user\" | \"bot\" | \"group\";\n * name: string | null;\n * ...\n * }\n * }\n * ```\n *\n * **Output:** `string | null`\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { NullableLastEditedByNameSchema } from \"@nakanoaas/notion-valibot-schema\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * LastEditedByName: NullableLastEditedByNameSchema,\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.LastEditedByName: string | null\n * ```\n */\nexport const NullableLastEditedByNameSchema = v.pipe(\n\tv.object({\n\t\tlast_edited_by: PersonSchema,\n\t}),\n\tv.transform((v) => v.last_edited_by.name),\n);\n\n/**\n * Schema to extract the `last_edited_by` person ID from a Notion page.\n *\n * **Input:**\n * ```\n * {\n * last_edited_by: {\n * id: string;\n * object: \"user\" | \"bot\" | \"group\";\n * name: string | null;\n * ...\n * }\n * }\n * ```\n *\n * **Output:** `string`\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { LastEditedByIdSchema } from \"@nakanoaas/notion-valibot-schema\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * LastEditedById: LastEditedByIdSchema,\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.LastEditedById: string\n * ```\n */\nexport const LastEditedByIdSchema = v.pipe(\n\tv.object({\n\t\tlast_edited_by: PersonSchema,\n\t}),\n\tv.transform((v) => v.last_edited_by.id),\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,MAAa,qBAAqBA,QAAE,KACnCA,QAAE,OAAO,EACR,gBAAgBC,eAAAA,aACjB,CAAC,GACDD,QAAE,WAAW,MAAM,EAAE,cAAc,CACpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,MAAa,iCAAiCA,QAAE,KAC/CA,QAAE,OAAO,EACR,gBAAgBC,eAAAA,aACjB,CAAC,GACDD,QAAE,WAAW,MAAM,EAAE,eAAe,IAAI,CACzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,MAAa,uBAAuBA,QAAE,KACrCA,QAAE,OAAO,EACR,gBAAgBC,eAAAA,aACjB,CAAC,GACDD,QAAE,WAAW,MAAM,EAAE,eAAe,EAAE,CACvC"}
|
package/dist/last-edited-by.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { PersonSchema } from "./people.mjs";
|
|
2
2
|
import * as v from "valibot";
|
|
3
|
-
|
|
4
3
|
//#region src/last-edited-by.ts
|
|
5
4
|
/**
|
|
6
5
|
* Schema to extract the `last_edited_by` person object from a Notion page.
|
|
@@ -114,7 +113,7 @@ const NullableLastEditedByNameSchema = v.pipe(v.object({ last_edited_by: PersonS
|
|
|
114
113
|
* ```
|
|
115
114
|
*/
|
|
116
115
|
const LastEditedByIdSchema = v.pipe(v.object({ last_edited_by: PersonSchema }), v.transform((v) => v.last_edited_by.id));
|
|
117
|
-
|
|
118
116
|
//#endregion
|
|
119
117
|
export { LastEditedByIdSchema, LastEditedBySchema, NullableLastEditedByNameSchema };
|
|
118
|
+
|
|
120
119
|
//# sourceMappingURL=last-edited-by.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"last-edited-by.mjs","names":[],"sources":["../src/last-edited-by.ts"],"sourcesContent":["import * as v from \"valibot\";\n\nimport { PersonSchema } from \"./people\";\n\n/**\n * Schema to extract the `last_edited_by` person object from a Notion page.\n *\n * **Input:**\n * ```\n * {\n * last_edited_by: {\n * id: string;\n * object: \"user\" | \"bot\" | \"group\";\n * name: string | null;\n * ...\n * }\n * }\n * ```\n *\n * **Output:**\n * ```\n * {\n * id: string;\n * object: \"user\" | \"bot\" | \"group\";\n * name: string | null;\n * }\n * ```\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { LastEditedBySchema } from \"@nakanoaas/notion-valibot-schema\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * LastEditedBy: LastEditedBySchema,\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.LastEditedBy: { id: string; object: \"user\" | \"bot\" | \"group\"; name: string | null }\n * ```\n */\nexport const LastEditedBySchema = v.pipe(\n\tv.object({\n\t\tlast_edited_by: PersonSchema,\n\t}),\n\tv.transform((v) => v.last_edited_by),\n);\n\n/**\n * Schema to extract the `last_edited_by` person name from a Notion page.\n *\n * **Input:**\n * ```\n * {\n * last_edited_by: {\n * id: string;\n * object: \"user\" | \"bot\" | \"group\";\n * name: string | null;\n * ...\n * }\n * }\n * ```\n *\n * **Output:** `string | null`\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { NullableLastEditedByNameSchema } from \"@nakanoaas/notion-valibot-schema\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * LastEditedByName: NullableLastEditedByNameSchema,\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.LastEditedByName: string | null\n * ```\n */\nexport const NullableLastEditedByNameSchema = v.pipe(\n\tv.object({\n\t\tlast_edited_by: PersonSchema,\n\t}),\n\tv.transform((v) => v.last_edited_by.name),\n);\n\n/**\n * Schema to extract the `last_edited_by` person ID from a Notion page.\n *\n * **Input:**\n * ```\n * {\n * last_edited_by: {\n * id: string;\n * object: \"user\" | \"bot\" | \"group\";\n * name: string | null;\n * ...\n * }\n * }\n * ```\n *\n * **Output:** `string`\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { LastEditedByIdSchema } from \"@nakanoaas/notion-valibot-schema\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * LastEditedById: LastEditedByIdSchema,\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.LastEditedById: string\n * ```\n */\nexport const LastEditedByIdSchema = v.pipe(\n\tv.object({\n\t\tlast_edited_by: PersonSchema,\n\t}),\n\tv.transform((v) => v.last_edited_by.id),\n);\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"last-edited-by.mjs","names":[],"sources":["../src/last-edited-by.ts"],"sourcesContent":["import * as v from \"valibot\";\n\nimport { PersonSchema } from \"./people\";\n\n/**\n * Schema to extract the `last_edited_by` person object from a Notion page.\n *\n * **Input:**\n * ```\n * {\n * last_edited_by: {\n * id: string;\n * object: \"user\" | \"bot\" | \"group\";\n * name: string | null;\n * ...\n * }\n * }\n * ```\n *\n * **Output:**\n * ```\n * {\n * id: string;\n * object: \"user\" | \"bot\" | \"group\";\n * name: string | null;\n * }\n * ```\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { LastEditedBySchema } from \"@nakanoaas/notion-valibot-schema\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * LastEditedBy: LastEditedBySchema,\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.LastEditedBy: { id: string; object: \"user\" | \"bot\" | \"group\"; name: string | null }\n * ```\n */\nexport const LastEditedBySchema = v.pipe(\n\tv.object({\n\t\tlast_edited_by: PersonSchema,\n\t}),\n\tv.transform((v) => v.last_edited_by),\n);\n\n/**\n * Schema to extract the `last_edited_by` person name from a Notion page.\n *\n * **Input:**\n * ```\n * {\n * last_edited_by: {\n * id: string;\n * object: \"user\" | \"bot\" | \"group\";\n * name: string | null;\n * ...\n * }\n * }\n * ```\n *\n * **Output:** `string | null`\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { NullableLastEditedByNameSchema } from \"@nakanoaas/notion-valibot-schema\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * LastEditedByName: NullableLastEditedByNameSchema,\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.LastEditedByName: string | null\n * ```\n */\nexport const NullableLastEditedByNameSchema = v.pipe(\n\tv.object({\n\t\tlast_edited_by: PersonSchema,\n\t}),\n\tv.transform((v) => v.last_edited_by.name),\n);\n\n/**\n * Schema to extract the `last_edited_by` person ID from a Notion page.\n *\n * **Input:**\n * ```\n * {\n * last_edited_by: {\n * id: string;\n * object: \"user\" | \"bot\" | \"group\";\n * name: string | null;\n * ...\n * }\n * }\n * ```\n *\n * **Output:** `string`\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { LastEditedByIdSchema } from \"@nakanoaas/notion-valibot-schema\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * LastEditedById: LastEditedByIdSchema,\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.LastEditedById: string\n * ```\n */\nexport const LastEditedByIdSchema = v.pipe(\n\tv.object({\n\t\tlast_edited_by: PersonSchema,\n\t}),\n\tv.transform((v) => v.last_edited_by.id),\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,MAAa,qBAAqB,EAAE,KACnC,EAAE,OAAO,EACR,gBAAgB,aACjB,CAAC,GACD,EAAE,WAAW,MAAM,EAAE,cAAc,CACpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,MAAa,iCAAiC,EAAE,KAC/C,EAAE,OAAO,EACR,gBAAgB,aACjB,CAAC,GACD,EAAE,WAAW,MAAM,EAAE,eAAe,IAAI,CACzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,MAAa,uBAAuB,EAAE,KACrC,EAAE,OAAO,EACR,gBAAgB,aACjB,CAAC,GACD,EAAE,WAAW,MAAM,EAAE,eAAe,EAAE,CACvC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
const require_runtime = require(
|
|
1
|
+
const require_runtime = require("./_virtual/_rolldown/runtime.cjs");
|
|
2
2
|
let valibot = require("valibot");
|
|
3
|
-
valibot = require_runtime.__toESM(valibot);
|
|
4
|
-
|
|
3
|
+
valibot = require_runtime.__toESM(valibot, 1);
|
|
5
4
|
//#region src/last-edited-time.ts
|
|
6
5
|
/**
|
|
7
6
|
* Schema to extract the `last_edited_time` property from a Notion page and transform it to a `Date` object.
|
|
@@ -31,7 +30,7 @@ valibot = require_runtime.__toESM(valibot);
|
|
|
31
30
|
* ```
|
|
32
31
|
*/
|
|
33
32
|
const LastEditedTimeSchema = valibot.pipe(valibot.object({ last_edited_time: valibot.string() }), valibot.transform((v) => new Date(v.last_edited_time)));
|
|
34
|
-
|
|
35
33
|
//#endregion
|
|
36
34
|
exports.LastEditedTimeSchema = LastEditedTimeSchema;
|
|
35
|
+
|
|
37
36
|
//# sourceMappingURL=last-edited-time.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"last-edited-time.cjs","names":["v"],"sources":["../src/last-edited-time.ts"],"sourcesContent":["import * as v from \"valibot\";\n\n/**\n * Schema to extract the `last_edited_time` property from a Notion page and transform it to a `Date` object.\n *\n * **Input:**\n * ```\n * {\n * last_edited_time: string;\n * }\n * ```\n *\n * **Output:** `Date`\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { LastEditedTimeSchema } from \"@nakanoaas/notion-valibot-utils\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * last_edited_time: LastEditedTimeSchema,\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.last_edited_time: Date\n * ```\n */\nexport const LastEditedTimeSchema = v.pipe(\n\tv.object({\n\t\tlast_edited_time: v.string(),\n\t}),\n\tv.transform((v) => new Date(v.last_edited_time)),\n);\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"last-edited-time.cjs","names":["v"],"sources":["../src/last-edited-time.ts"],"sourcesContent":["import * as v from \"valibot\";\n\n/**\n * Schema to extract the `last_edited_time` property from a Notion page and transform it to a `Date` object.\n *\n * **Input:**\n * ```\n * {\n * last_edited_time: string;\n * }\n * ```\n *\n * **Output:** `Date`\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { LastEditedTimeSchema } from \"@nakanoaas/notion-valibot-utils\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * last_edited_time: LastEditedTimeSchema,\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.last_edited_time: Date\n * ```\n */\nexport const LastEditedTimeSchema = v.pipe(\n\tv.object({\n\t\tlast_edited_time: v.string(),\n\t}),\n\tv.transform((v) => new Date(v.last_edited_time)),\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,MAAa,uBAAuBA,QAAE,KACrCA,QAAE,OAAO,EACR,kBAAkBA,QAAE,OAAO,EAC5B,CAAC,GACDA,QAAE,WAAW,MAAM,IAAI,KAAK,EAAE,gBAAgB,CAAC,CAChD"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
|
-
|
|
3
2
|
//#region src/last-edited-time.ts
|
|
4
3
|
/**
|
|
5
4
|
* Schema to extract the `last_edited_time` property from a Notion page and transform it to a `Date` object.
|
|
@@ -29,7 +28,7 @@ import * as v from "valibot";
|
|
|
29
28
|
* ```
|
|
30
29
|
*/
|
|
31
30
|
const LastEditedTimeSchema = v.pipe(v.object({ last_edited_time: v.string() }), v.transform((v) => new Date(v.last_edited_time)));
|
|
32
|
-
|
|
33
31
|
//#endregion
|
|
34
32
|
export { LastEditedTimeSchema };
|
|
33
|
+
|
|
35
34
|
//# sourceMappingURL=last-edited-time.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"last-edited-time.mjs","names":[],"sources":["../src/last-edited-time.ts"],"sourcesContent":["import * as v from \"valibot\";\n\n/**\n * Schema to extract the `last_edited_time` property from a Notion page and transform it to a `Date` object.\n *\n * **Input:**\n * ```\n * {\n * last_edited_time: string;\n * }\n * ```\n *\n * **Output:** `Date`\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { LastEditedTimeSchema } from \"@nakanoaas/notion-valibot-utils\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * last_edited_time: LastEditedTimeSchema,\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.last_edited_time: Date\n * ```\n */\nexport const LastEditedTimeSchema = v.pipe(\n\tv.object({\n\t\tlast_edited_time: v.string(),\n\t}),\n\tv.transform((v) => new Date(v.last_edited_time)),\n);\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"last-edited-time.mjs","names":[],"sources":["../src/last-edited-time.ts"],"sourcesContent":["import * as v from \"valibot\";\n\n/**\n * Schema to extract the `last_edited_time` property from a Notion page and transform it to a `Date` object.\n *\n * **Input:**\n * ```\n * {\n * last_edited_time: string;\n * }\n * ```\n *\n * **Output:** `Date`\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { LastEditedTimeSchema } from \"@nakanoaas/notion-valibot-utils\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * last_edited_time: LastEditedTimeSchema,\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.last_edited_time: Date\n * ```\n */\nexport const LastEditedTimeSchema = v.pipe(\n\tv.object({\n\t\tlast_edited_time: v.string(),\n\t}),\n\tv.transform((v) => new Date(v.last_edited_time)),\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,MAAa,uBAAuB,EAAE,KACrC,EAAE,OAAO,EACR,kBAAkB,EAAE,OAAO,EAC5B,CAAC,GACD,EAAE,WAAW,MAAM,IAAI,KAAK,EAAE,gBAAgB,CAAC,CAChD"}
|
package/dist/multi-select.cjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
const require_runtime = require(
|
|
1
|
+
const require_runtime = require("./_virtual/_rolldown/runtime.cjs");
|
|
2
2
|
let valibot = require("valibot");
|
|
3
|
-
valibot = require_runtime.__toESM(valibot);
|
|
4
|
-
|
|
3
|
+
valibot = require_runtime.__toESM(valibot, 1);
|
|
5
4
|
//#region src/multi-select.ts
|
|
6
5
|
/**
|
|
7
6
|
* Schema factory to extract the `multi_select` property from a Notion page property.
|
|
@@ -66,7 +65,7 @@ valibot = require_runtime.__toESM(valibot);
|
|
|
66
65
|
function MultiSelectSchema(schema) {
|
|
67
66
|
return valibot.pipe(valibot.object({ multi_select: valibot.array(valibot.object({ name: schema })) }), valibot.transform((v) => v.multi_select.map((v) => v.name)));
|
|
68
67
|
}
|
|
69
|
-
|
|
70
68
|
//#endregion
|
|
71
69
|
exports.MultiSelectSchema = MultiSelectSchema;
|
|
70
|
+
|
|
72
71
|
//# sourceMappingURL=multi-select.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multi-select.cjs","names":["v"],"sources":["../src/multi-select.ts"],"sourcesContent":["import * as v from \"valibot\";\n\n/**\n * Schema factory to extract the `multi_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 multi-select values. The multi-select property in Notion contains an\n * array of objects with a `name` field that can be validated using the provided schema.\n *\n * **Input:**\n * ```\n * {\n * multi_select: Array<{\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 multi-select option name.\n * Must accept a string value.\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { MultiSelectSchema } from \"@nakanoaas/notion-valibot-utils\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * Tags: MultiSelectSchema(v.string()),\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.Tags: string[]\n * ```\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { MultiSelectSchema } from \"@nakanoaas/notion-valibot-utils\";\n *\n * // Custom schema for enum values\n * const TagSchema = v.picklist([\"urgent\", \"important\", \"normal\"]);\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * Tags: MultiSelectSchema(TagSchema),\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.Tags: (\"urgent\" | \"important\" | \"normal\")[]\n * ```\n */\nexport function MultiSelectSchema<S extends v.GenericSchema<string>>(\n\tschema: S,\n) {\n\treturn v.pipe(\n\t\tv.object({\n\t\t\tmulti_select: v.array(\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\t// biome-ignore lint/style/noNonNullAssertion: valibot inference is not working correctly\n\t\tv.transform((v) => v.multi_select.map((v) => v.name!)),\n\t);\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"multi-select.cjs","names":["v"],"sources":["../src/multi-select.ts"],"sourcesContent":["import * as v from \"valibot\";\n\n/**\n * Schema factory to extract the `multi_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 multi-select values. The multi-select property in Notion contains an\n * array of objects with a `name` field that can be validated using the provided schema.\n *\n * **Input:**\n * ```\n * {\n * multi_select: Array<{\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 multi-select option name.\n * Must accept a string value.\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { MultiSelectSchema } from \"@nakanoaas/notion-valibot-utils\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * Tags: MultiSelectSchema(v.string()),\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.Tags: string[]\n * ```\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { MultiSelectSchema } from \"@nakanoaas/notion-valibot-utils\";\n *\n * // Custom schema for enum values\n * const TagSchema = v.picklist([\"urgent\", \"important\", \"normal\"]);\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * Tags: MultiSelectSchema(TagSchema),\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.Tags: (\"urgent\" | \"important\" | \"normal\")[]\n * ```\n */\nexport function MultiSelectSchema<S extends v.GenericSchema<string>>(\n\tschema: S,\n) {\n\treturn v.pipe(\n\t\tv.object({\n\t\t\tmulti_select: v.array(\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\t// biome-ignore lint/style/noNonNullAssertion: valibot inference is not working correctly\n\t\tv.transform((v) => v.multi_select.map((v) => v.name!)),\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8DA,SAAgB,kBACf,QACC;CACD,OAAOA,QAAE,KACRA,QAAE,OAAO,EACR,cAAcA,QAAE,MACfA,QAAE,OAAO,EACR,MAAM,OACP,CAAC,CACF,EACD,CAAC,GAEDA,QAAE,WAAW,MAAM,EAAE,aAAa,KAAK,MAAM,EAAE,IAAK,CAAC,CACtD;AACD"}
|
package/dist/multi-select.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
|
-
|
|
3
2
|
//#region src/multi-select.ts
|
|
4
3
|
/**
|
|
5
4
|
* Schema factory to extract the `multi_select` property from a Notion page property.
|
|
@@ -64,7 +63,7 @@ import * as v from "valibot";
|
|
|
64
63
|
function MultiSelectSchema(schema) {
|
|
65
64
|
return v.pipe(v.object({ multi_select: v.array(v.object({ name: schema })) }), v.transform((v) => v.multi_select.map((v) => v.name)));
|
|
66
65
|
}
|
|
67
|
-
|
|
68
66
|
//#endregion
|
|
69
67
|
export { MultiSelectSchema };
|
|
68
|
+
|
|
70
69
|
//# sourceMappingURL=multi-select.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multi-select.mjs","names":[],"sources":["../src/multi-select.ts"],"sourcesContent":["import * as v from \"valibot\";\n\n/**\n * Schema factory to extract the `multi_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 multi-select values. The multi-select property in Notion contains an\n * array of objects with a `name` field that can be validated using the provided schema.\n *\n * **Input:**\n * ```\n * {\n * multi_select: Array<{\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 multi-select option name.\n * Must accept a string value.\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { MultiSelectSchema } from \"@nakanoaas/notion-valibot-utils\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * Tags: MultiSelectSchema(v.string()),\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.Tags: string[]\n * ```\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { MultiSelectSchema } from \"@nakanoaas/notion-valibot-utils\";\n *\n * // Custom schema for enum values\n * const TagSchema = v.picklist([\"urgent\", \"important\", \"normal\"]);\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * Tags: MultiSelectSchema(TagSchema),\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.Tags: (\"urgent\" | \"important\" | \"normal\")[]\n * ```\n */\nexport function MultiSelectSchema<S extends v.GenericSchema<string>>(\n\tschema: S,\n) {\n\treturn v.pipe(\n\t\tv.object({\n\t\t\tmulti_select: v.array(\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\t// biome-ignore lint/style/noNonNullAssertion: valibot inference is not working correctly\n\t\tv.transform((v) => v.multi_select.map((v) => v.name!)),\n\t);\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"multi-select.mjs","names":[],"sources":["../src/multi-select.ts"],"sourcesContent":["import * as v from \"valibot\";\n\n/**\n * Schema factory to extract the `multi_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 multi-select values. The multi-select property in Notion contains an\n * array of objects with a `name` field that can be validated using the provided schema.\n *\n * **Input:**\n * ```\n * {\n * multi_select: Array<{\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 multi-select option name.\n * Must accept a string value.\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { MultiSelectSchema } from \"@nakanoaas/notion-valibot-utils\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * Tags: MultiSelectSchema(v.string()),\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.Tags: string[]\n * ```\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { MultiSelectSchema } from \"@nakanoaas/notion-valibot-utils\";\n *\n * // Custom schema for enum values\n * const TagSchema = v.picklist([\"urgent\", \"important\", \"normal\"]);\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * Tags: MultiSelectSchema(TagSchema),\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.Tags: (\"urgent\" | \"important\" | \"normal\")[]\n * ```\n */\nexport function MultiSelectSchema<S extends v.GenericSchema<string>>(\n\tschema: S,\n) {\n\treturn v.pipe(\n\t\tv.object({\n\t\t\tmulti_select: v.array(\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\t// biome-ignore lint/style/noNonNullAssertion: valibot inference is not working correctly\n\t\tv.transform((v) => v.multi_select.map((v) => v.name!)),\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8DA,SAAgB,kBACf,QACC;CACD,OAAO,EAAE,KACR,EAAE,OAAO,EACR,cAAc,EAAE,MACf,EAAE,OAAO,EACR,MAAM,OACP,CAAC,CACF,EACD,CAAC,GAED,EAAE,WAAW,MAAM,EAAE,aAAa,KAAK,MAAM,EAAE,IAAK,CAAC,CACtD;AACD"}
|
package/dist/number.cjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
const require_runtime = require(
|
|
1
|
+
const require_runtime = require("./_virtual/_rolldown/runtime.cjs");
|
|
2
2
|
let valibot = require("valibot");
|
|
3
|
-
valibot = require_runtime.__toESM(valibot);
|
|
4
|
-
|
|
3
|
+
valibot = require_runtime.__toESM(valibot, 1);
|
|
5
4
|
//#region src/number.ts
|
|
6
5
|
/**
|
|
7
6
|
* Schema to extract the `number` property from a Notion page property.
|
|
@@ -63,8 +62,8 @@ const NumberSchema = valibot.pipe(valibot.object({ number: valibot.number() }),
|
|
|
63
62
|
* ```
|
|
64
63
|
*/
|
|
65
64
|
const NullableNumberSchema = valibot.pipe(valibot.object({ number: valibot.nullable(valibot.number()) }), valibot.transform((v) => v.number));
|
|
66
|
-
|
|
67
65
|
//#endregion
|
|
68
66
|
exports.NullableNumberSchema = NullableNumberSchema;
|
|
69
67
|
exports.NumberSchema = NumberSchema;
|
|
68
|
+
|
|
70
69
|
//# sourceMappingURL=number.cjs.map
|
package/dist/number.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"number.cjs","names":["v"],"sources":["../src/number.ts"],"sourcesContent":["import * as v from \"valibot\";\n\n/**\n * Schema to extract the `number` property from a Notion page property.\n *\n * **Input:**\n * ```\n * {\n * number: number;\n * }\n * ```\n *\n * **Output:** `number`\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { NumberSchema } from \"@nakanoaas/notion-valibot-utils\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * Number: NumberSchema,\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.Number: number\n * ```\n */\nexport const NumberSchema = v.pipe(\n\tv.object({\n\t\tnumber: v.number(),\n\t}),\n\tv.transform((v) => v.number),\n);\n\n/**\n * Schema to extract the `number` property from a Notion page property or `null`.\n *\n * **Input:**\n * ```\n * {\n * number: number | null;\n * }\n * ```\n *\n * **Output:** `number | null`\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { NullableNumberSchema } from \"@nakanoaas/notion-valibot-utils\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * Number: NullableNumberSchema,\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.Number: number | null\n * ```\n */\nexport const NullableNumberSchema = v.pipe(\n\tv.object({\n\t\tnumber: v.nullable(v.number()),\n\t}),\n\tv.transform((v) => v.number),\n);\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"number.cjs","names":["v"],"sources":["../src/number.ts"],"sourcesContent":["import * as v from \"valibot\";\n\n/**\n * Schema to extract the `number` property from a Notion page property.\n *\n * **Input:**\n * ```\n * {\n * number: number;\n * }\n * ```\n *\n * **Output:** `number`\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { NumberSchema } from \"@nakanoaas/notion-valibot-utils\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * Number: NumberSchema,\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.Number: number\n * ```\n */\nexport const NumberSchema = v.pipe(\n\tv.object({\n\t\tnumber: v.number(),\n\t}),\n\tv.transform((v) => v.number),\n);\n\n/**\n * Schema to extract the `number` property from a Notion page property or `null`.\n *\n * **Input:**\n * ```\n * {\n * number: number | null;\n * }\n * ```\n *\n * **Output:** `number | null`\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { NullableNumberSchema } from \"@nakanoaas/notion-valibot-utils\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * Number: NullableNumberSchema,\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.Number: number | null\n * ```\n */\nexport const NullableNumberSchema = v.pipe(\n\tv.object({\n\t\tnumber: v.nullable(v.number()),\n\t}),\n\tv.transform((v) => v.number),\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,MAAa,eAAeA,QAAE,KAC7BA,QAAE,OAAO,EACR,QAAQA,QAAE,OAAO,EAClB,CAAC,GACDA,QAAE,WAAW,MAAM,EAAE,MAAM,CAC5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,MAAa,uBAAuBA,QAAE,KACrCA,QAAE,OAAO,EACR,QAAQA,QAAE,SAASA,QAAE,OAAO,CAAC,EAC9B,CAAC,GACDA,QAAE,WAAW,MAAM,EAAE,MAAM,CAC5B"}
|
package/dist/number.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
|
-
|
|
3
2
|
//#region src/number.ts
|
|
4
3
|
/**
|
|
5
4
|
* Schema to extract the `number` property from a Notion page property.
|
|
@@ -61,7 +60,7 @@ const NumberSchema = v.pipe(v.object({ number: v.number() }), v.transform((v) =>
|
|
|
61
60
|
* ```
|
|
62
61
|
*/
|
|
63
62
|
const NullableNumberSchema = v.pipe(v.object({ number: v.nullable(v.number()) }), v.transform((v) => v.number));
|
|
64
|
-
|
|
65
63
|
//#endregion
|
|
66
64
|
export { NullableNumberSchema, NumberSchema };
|
|
65
|
+
|
|
67
66
|
//# sourceMappingURL=number.mjs.map
|
package/dist/number.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"number.mjs","names":[],"sources":["../src/number.ts"],"sourcesContent":["import * as v from \"valibot\";\n\n/**\n * Schema to extract the `number` property from a Notion page property.\n *\n * **Input:**\n * ```\n * {\n * number: number;\n * }\n * ```\n *\n * **Output:** `number`\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { NumberSchema } from \"@nakanoaas/notion-valibot-utils\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * Number: NumberSchema,\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.Number: number\n * ```\n */\nexport const NumberSchema = v.pipe(\n\tv.object({\n\t\tnumber: v.number(),\n\t}),\n\tv.transform((v) => v.number),\n);\n\n/**\n * Schema to extract the `number` property from a Notion page property or `null`.\n *\n * **Input:**\n * ```\n * {\n * number: number | null;\n * }\n * ```\n *\n * **Output:** `number | null`\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { NullableNumberSchema } from \"@nakanoaas/notion-valibot-utils\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * Number: NullableNumberSchema,\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.Number: number | null\n * ```\n */\nexport const NullableNumberSchema = v.pipe(\n\tv.object({\n\t\tnumber: v.nullable(v.number()),\n\t}),\n\tv.transform((v) => v.number),\n);\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"number.mjs","names":[],"sources":["../src/number.ts"],"sourcesContent":["import * as v from \"valibot\";\n\n/**\n * Schema to extract the `number` property from a Notion page property.\n *\n * **Input:**\n * ```\n * {\n * number: number;\n * }\n * ```\n *\n * **Output:** `number`\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { NumberSchema } from \"@nakanoaas/notion-valibot-utils\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * Number: NumberSchema,\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.Number: number\n * ```\n */\nexport const NumberSchema = v.pipe(\n\tv.object({\n\t\tnumber: v.number(),\n\t}),\n\tv.transform((v) => v.number),\n);\n\n/**\n * Schema to extract the `number` property from a Notion page property or `null`.\n *\n * **Input:**\n * ```\n * {\n * number: number | null;\n * }\n * ```\n *\n * **Output:** `number | null`\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { NullableNumberSchema } from \"@nakanoaas/notion-valibot-utils\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * Number: NullableNumberSchema,\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.Number: number | null\n * ```\n */\nexport const NullableNumberSchema = v.pipe(\n\tv.object({\n\t\tnumber: v.nullable(v.number()),\n\t}),\n\tv.transform((v) => v.number),\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,MAAa,eAAe,EAAE,KAC7B,EAAE,OAAO,EACR,QAAQ,EAAE,OAAO,EAClB,CAAC,GACD,EAAE,WAAW,MAAM,EAAE,MAAM,CAC5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,MAAa,uBAAuB,EAAE,KACrC,EAAE,OAAO,EACR,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC,EAC9B,CAAC,GACD,EAAE,WAAW,MAAM,EAAE,MAAM,CAC5B"}
|
package/dist/people.cjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
const require_runtime = require(
|
|
1
|
+
const require_runtime = require("./_virtual/_rolldown/runtime.cjs");
|
|
2
2
|
let valibot = require("valibot");
|
|
3
|
-
valibot = require_runtime.__toESM(valibot);
|
|
4
|
-
|
|
3
|
+
valibot = require_runtime.__toESM(valibot, 1);
|
|
5
4
|
//#region src/people.ts
|
|
6
5
|
/**
|
|
7
6
|
* Schema for a Notion person object (user, bot, or group).
|
|
@@ -137,9 +136,9 @@ const PeopleSchema = valibot.pipe(valibot.object({ people: valibot.array(PersonS
|
|
|
137
136
|
* ```
|
|
138
137
|
*/
|
|
139
138
|
const PeopleIdSchema = valibot.pipe(valibot.object({ people: valibot.array(PersonSchema) }), valibot.transform((v) => v.people.map((p) => p.id)));
|
|
140
|
-
|
|
141
139
|
//#endregion
|
|
142
140
|
exports.PeopleIdSchema = PeopleIdSchema;
|
|
143
141
|
exports.PeopleSchema = PeopleSchema;
|
|
144
142
|
exports.PersonSchema = PersonSchema;
|
|
143
|
+
|
|
145
144
|
//# sourceMappingURL=people.cjs.map
|
package/dist/people.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"people.cjs","names":["v"],"sources":["../src/people.ts"],"sourcesContent":["import * as v from \"valibot\";\n\n/**\n * Schema for a Notion person object (user, bot, or group).\n *\n * **Input:**\n * ```\n * {\n * id: string;\n * object: \"user\" | \"bot\" | \"group\";\n * name: string | null;\n * ...\n * }\n * ```\n *\n * **Output:**\n * ```\n * {\n * id: string;\n * object: \"user\" | \"bot\" | \"group\";\n * name: string | null;\n * }\n * ```\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { PersonSchema } from \"@nakanoaas/notion-valibot-schema\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * created_by: PersonSchema,\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.created_by: { id: string; object: \"user\" | \"bot\" | \"group\"; name: string | null }\n * ```\n *\n * @internal\n */\nexport const PersonSchema = v.object({\n\tid: v.string(),\n\tobject: v.picklist([\"user\", \"bot\", \"group\"]),\n\tname: v.nullish(v.string(), null),\n});\n\n/**\n * Schema to extract the `people` array from a Notion property.\n *\n * **Input:**\n * ```\n * {\n * people: [\n * {\n * id: string;\n * object: \"user\" | \"bot\" | \"group\";\n * name: string | null;\n * ...\n * }\n * ]\n * }\n * ```\n *\n * **Output:**\n * ```\n * [\n * {\n * id: string;\n * object: \"user\" | \"bot\" | \"group\";\n * name: string | null;\n * }\n * ]\n * ```\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { PeopleSchema } from \"@nakanoaas/notion-valibot-schema\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * People: PeopleSchema,\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.People: Array<{ id: string; object: \"user\" | \"bot\" | \"group\"; name: string | null }>\n * ```\n */\nexport const PeopleSchema = v.pipe(\n\tv.object({\n\t\tpeople: v.array(PersonSchema),\n\t}),\n\tv.transform((v) => v.people),\n);\n\n/**\n * Schema to extract the `people` array of IDs from a Notion property.\n *\n * **Input:**\n * ```\n * {\n * people: [\n * {\n * id: string;\n * object: \"user\" | \"bot\" | \"group\";\n * name: string | null;\n * ...\n * }\n * ]\n * }\n * ```\n *\n * **Output:**\n * ```\n * [string]\n * ```\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { PeopleIdSchema } from \"@nakanoaas/notion-valibot-schema\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * People: PeopleIdSchema,\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.People: [string]\n * ```\n */\nexport const PeopleIdSchema = v.pipe(\n\tv.object({\n\t\tpeople: v.array(PersonSchema),\n\t}),\n\tv.transform((v) => v.people.map((p) => p.id)),\n);\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"people.cjs","names":["v"],"sources":["../src/people.ts"],"sourcesContent":["import * as v from \"valibot\";\n\n/**\n * Schema for a Notion person object (user, bot, or group).\n *\n * **Input:**\n * ```\n * {\n * id: string;\n * object: \"user\" | \"bot\" | \"group\";\n * name: string | null;\n * ...\n * }\n * ```\n *\n * **Output:**\n * ```\n * {\n * id: string;\n * object: \"user\" | \"bot\" | \"group\";\n * name: string | null;\n * }\n * ```\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { PersonSchema } from \"@nakanoaas/notion-valibot-schema\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * created_by: PersonSchema,\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.created_by: { id: string; object: \"user\" | \"bot\" | \"group\"; name: string | null }\n * ```\n *\n * @internal\n */\nexport const PersonSchema = v.object({\n\tid: v.string(),\n\tobject: v.picklist([\"user\", \"bot\", \"group\"]),\n\tname: v.nullish(v.string(), null),\n});\n\n/**\n * Schema to extract the `people` array from a Notion property.\n *\n * **Input:**\n * ```\n * {\n * people: [\n * {\n * id: string;\n * object: \"user\" | \"bot\" | \"group\";\n * name: string | null;\n * ...\n * }\n * ]\n * }\n * ```\n *\n * **Output:**\n * ```\n * [\n * {\n * id: string;\n * object: \"user\" | \"bot\" | \"group\";\n * name: string | null;\n * }\n * ]\n * ```\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { PeopleSchema } from \"@nakanoaas/notion-valibot-schema\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * People: PeopleSchema,\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.People: Array<{ id: string; object: \"user\" | \"bot\" | \"group\"; name: string | null }>\n * ```\n */\nexport const PeopleSchema = v.pipe(\n\tv.object({\n\t\tpeople: v.array(PersonSchema),\n\t}),\n\tv.transform((v) => v.people),\n);\n\n/**\n * Schema to extract the `people` array of IDs from a Notion property.\n *\n * **Input:**\n * ```\n * {\n * people: [\n * {\n * id: string;\n * object: \"user\" | \"bot\" | \"group\";\n * name: string | null;\n * ...\n * }\n * ]\n * }\n * ```\n *\n * **Output:**\n * ```\n * [string]\n * ```\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { PeopleIdSchema } from \"@nakanoaas/notion-valibot-schema\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * People: PeopleIdSchema,\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.People: [string]\n * ```\n */\nexport const PeopleIdSchema = v.pipe(\n\tv.object({\n\t\tpeople: v.array(PersonSchema),\n\t}),\n\tv.transform((v) => v.people.map((p) => p.id)),\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA,MAAa,eAAeA,QAAE,OAAO;CACpC,IAAIA,QAAE,OAAO;CACb,QAAQA,QAAE,SAAS;EAAC;EAAQ;EAAO;CAAO,CAAC;CAC3C,MAAMA,QAAE,QAAQA,QAAE,OAAO,GAAG,IAAI;AACjC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CD,MAAa,eAAeA,QAAE,KAC7BA,QAAE,OAAO,EACR,QAAQA,QAAE,MAAM,YAAY,EAC7B,CAAC,GACDA,QAAE,WAAW,MAAM,EAAE,MAAM,CAC5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA,MAAa,iBAAiBA,QAAE,KAC/BA,QAAE,OAAO,EACR,QAAQA,QAAE,MAAM,YAAY,EAC7B,CAAC,GACDA,QAAE,WAAW,MAAM,EAAE,OAAO,KAAK,MAAM,EAAE,EAAE,CAAC,CAC7C"}
|
package/dist/people.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
|
-
|
|
3
2
|
//#region src/people.ts
|
|
4
3
|
/**
|
|
5
4
|
* Schema for a Notion person object (user, bot, or group).
|
|
@@ -135,7 +134,7 @@ const PeopleSchema = v.pipe(v.object({ people: v.array(PersonSchema) }), v.trans
|
|
|
135
134
|
* ```
|
|
136
135
|
*/
|
|
137
136
|
const PeopleIdSchema = v.pipe(v.object({ people: v.array(PersonSchema) }), v.transform((v) => v.people.map((p) => p.id)));
|
|
138
|
-
|
|
139
137
|
//#endregion
|
|
140
138
|
export { PeopleIdSchema, PeopleSchema, PersonSchema };
|
|
139
|
+
|
|
141
140
|
//# sourceMappingURL=people.mjs.map
|
package/dist/people.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"people.mjs","names":[],"sources":["../src/people.ts"],"sourcesContent":["import * as v from \"valibot\";\n\n/**\n * Schema for a Notion person object (user, bot, or group).\n *\n * **Input:**\n * ```\n * {\n * id: string;\n * object: \"user\" | \"bot\" | \"group\";\n * name: string | null;\n * ...\n * }\n * ```\n *\n * **Output:**\n * ```\n * {\n * id: string;\n * object: \"user\" | \"bot\" | \"group\";\n * name: string | null;\n * }\n * ```\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { PersonSchema } from \"@nakanoaas/notion-valibot-schema\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * created_by: PersonSchema,\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.created_by: { id: string; object: \"user\" | \"bot\" | \"group\"; name: string | null }\n * ```\n *\n * @internal\n */\nexport const PersonSchema = v.object({\n\tid: v.string(),\n\tobject: v.picklist([\"user\", \"bot\", \"group\"]),\n\tname: v.nullish(v.string(), null),\n});\n\n/**\n * Schema to extract the `people` array from a Notion property.\n *\n * **Input:**\n * ```\n * {\n * people: [\n * {\n * id: string;\n * object: \"user\" | \"bot\" | \"group\";\n * name: string | null;\n * ...\n * }\n * ]\n * }\n * ```\n *\n * **Output:**\n * ```\n * [\n * {\n * id: string;\n * object: \"user\" | \"bot\" | \"group\";\n * name: string | null;\n * }\n * ]\n * ```\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { PeopleSchema } from \"@nakanoaas/notion-valibot-schema\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * People: PeopleSchema,\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.People: Array<{ id: string; object: \"user\" | \"bot\" | \"group\"; name: string | null }>\n * ```\n */\nexport const PeopleSchema = v.pipe(\n\tv.object({\n\t\tpeople: v.array(PersonSchema),\n\t}),\n\tv.transform((v) => v.people),\n);\n\n/**\n * Schema to extract the `people` array of IDs from a Notion property.\n *\n * **Input:**\n * ```\n * {\n * people: [\n * {\n * id: string;\n * object: \"user\" | \"bot\" | \"group\";\n * name: string | null;\n * ...\n * }\n * ]\n * }\n * ```\n *\n * **Output:**\n * ```\n * [string]\n * ```\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { PeopleIdSchema } from \"@nakanoaas/notion-valibot-schema\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * People: PeopleIdSchema,\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.People: [string]\n * ```\n */\nexport const PeopleIdSchema = v.pipe(\n\tv.object({\n\t\tpeople: v.array(PersonSchema),\n\t}),\n\tv.transform((v) => v.people.map((p) => p.id)),\n);\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"people.mjs","names":[],"sources":["../src/people.ts"],"sourcesContent":["import * as v from \"valibot\";\n\n/**\n * Schema for a Notion person object (user, bot, or group).\n *\n * **Input:**\n * ```\n * {\n * id: string;\n * object: \"user\" | \"bot\" | \"group\";\n * name: string | null;\n * ...\n * }\n * ```\n *\n * **Output:**\n * ```\n * {\n * id: string;\n * object: \"user\" | \"bot\" | \"group\";\n * name: string | null;\n * }\n * ```\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { PersonSchema } from \"@nakanoaas/notion-valibot-schema\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * created_by: PersonSchema,\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.created_by: { id: string; object: \"user\" | \"bot\" | \"group\"; name: string | null }\n * ```\n *\n * @internal\n */\nexport const PersonSchema = v.object({\n\tid: v.string(),\n\tobject: v.picklist([\"user\", \"bot\", \"group\"]),\n\tname: v.nullish(v.string(), null),\n});\n\n/**\n * Schema to extract the `people` array from a Notion property.\n *\n * **Input:**\n * ```\n * {\n * people: [\n * {\n * id: string;\n * object: \"user\" | \"bot\" | \"group\";\n * name: string | null;\n * ...\n * }\n * ]\n * }\n * ```\n *\n * **Output:**\n * ```\n * [\n * {\n * id: string;\n * object: \"user\" | \"bot\" | \"group\";\n * name: string | null;\n * }\n * ]\n * ```\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { PeopleSchema } from \"@nakanoaas/notion-valibot-schema\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * People: PeopleSchema,\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.People: Array<{ id: string; object: \"user\" | \"bot\" | \"group\"; name: string | null }>\n * ```\n */\nexport const PeopleSchema = v.pipe(\n\tv.object({\n\t\tpeople: v.array(PersonSchema),\n\t}),\n\tv.transform((v) => v.people),\n);\n\n/**\n * Schema to extract the `people` array of IDs from a Notion property.\n *\n * **Input:**\n * ```\n * {\n * people: [\n * {\n * id: string;\n * object: \"user\" | \"bot\" | \"group\";\n * name: string | null;\n * ...\n * }\n * ]\n * }\n * ```\n *\n * **Output:**\n * ```\n * [string]\n * ```\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { PeopleIdSchema } from \"@nakanoaas/notion-valibot-schema\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * People: PeopleIdSchema,\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.People: [string]\n * ```\n */\nexport const PeopleIdSchema = v.pipe(\n\tv.object({\n\t\tpeople: v.array(PersonSchema),\n\t}),\n\tv.transform((v) => v.people.map((p) => p.id)),\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA,MAAa,eAAe,EAAE,OAAO;CACpC,IAAI,EAAE,OAAO;CACb,QAAQ,EAAE,SAAS;EAAC;EAAQ;EAAO;CAAO,CAAC;CAC3C,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI;AACjC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CD,MAAa,eAAe,EAAE,KAC7B,EAAE,OAAO,EACR,QAAQ,EAAE,MAAM,YAAY,EAC7B,CAAC,GACD,EAAE,WAAW,MAAM,EAAE,MAAM,CAC5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA,MAAa,iBAAiB,EAAE,KAC/B,EAAE,OAAO,EACR,QAAQ,EAAE,MAAM,YAAY,EAC7B,CAAC,GACD,EAAE,WAAW,MAAM,EAAE,OAAO,KAAK,MAAM,EAAE,EAAE,CAAC,CAC7C"}
|
package/dist/phone-number.cjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
const require_runtime = require(
|
|
1
|
+
const require_runtime = require("./_virtual/_rolldown/runtime.cjs");
|
|
2
2
|
let valibot = require("valibot");
|
|
3
|
-
valibot = require_runtime.__toESM(valibot);
|
|
4
|
-
|
|
3
|
+
valibot = require_runtime.__toESM(valibot, 1);
|
|
5
4
|
//#region src/phone-number.ts
|
|
6
5
|
/**
|
|
7
6
|
* Schema to extract the `phone_number` property from a Notion page property.
|
|
@@ -63,8 +62,8 @@ const PhoneNumberSchema = valibot.pipe(valibot.object({ phone_number: valibot.st
|
|
|
63
62
|
* ```
|
|
64
63
|
*/
|
|
65
64
|
const NullablePhoneNumberSchema = valibot.pipe(valibot.object({ phone_number: valibot.nullable(valibot.string()) }), valibot.transform((v) => v.phone_number));
|
|
66
|
-
|
|
67
65
|
//#endregion
|
|
68
66
|
exports.NullablePhoneNumberSchema = NullablePhoneNumberSchema;
|
|
69
67
|
exports.PhoneNumberSchema = PhoneNumberSchema;
|
|
68
|
+
|
|
70
69
|
//# sourceMappingURL=phone-number.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phone-number.cjs","names":["v"],"sources":["../src/phone-number.ts"],"sourcesContent":["import * as v from \"valibot\";\n\n/**\n * Schema to extract the `phone_number` property from a Notion page property.\n *\n * **Input:**\n * ```\n * {\n * phone_number: string;\n * }\n * ```\n *\n * **Output:** `string`\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { PhoneNumberSchema } from \"@nakanoaas/notion-valibot-utils\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * Phone: PhoneNumberSchema,\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.Phone: string\n * ```\n */\nexport const PhoneNumberSchema = v.pipe(\n\tv.object({\n\t\tphone_number: v.string(),\n\t}),\n\tv.transform((v) => v.phone_number),\n);\n\n/**\n * Schema to extract the `phone_number` property from a Notion page property or `null`.\n *\n * **Input:**\n * ```\n * {\n * phone_number: string | null;\n * }\n * ```\n *\n * **Output:** `string | null`\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { NullablePhoneNumberSchema } from \"@nakanoaas/notion-valibot-utils\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * Phone: NullablePhoneNumberSchema,\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.Phone: string | null\n * ```\n */\nexport const NullablePhoneNumberSchema = v.pipe(\n\tv.object({\n\t\tphone_number: v.nullable(v.string()),\n\t}),\n\tv.transform((v) => v.phone_number),\n);\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"phone-number.cjs","names":["v"],"sources":["../src/phone-number.ts"],"sourcesContent":["import * as v from \"valibot\";\n\n/**\n * Schema to extract the `phone_number` property from a Notion page property.\n *\n * **Input:**\n * ```\n * {\n * phone_number: string;\n * }\n * ```\n *\n * **Output:** `string`\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { PhoneNumberSchema } from \"@nakanoaas/notion-valibot-utils\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * Phone: PhoneNumberSchema,\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.Phone: string\n * ```\n */\nexport const PhoneNumberSchema = v.pipe(\n\tv.object({\n\t\tphone_number: v.string(),\n\t}),\n\tv.transform((v) => v.phone_number),\n);\n\n/**\n * Schema to extract the `phone_number` property from a Notion page property or `null`.\n *\n * **Input:**\n * ```\n * {\n * phone_number: string | null;\n * }\n * ```\n *\n * **Output:** `string | null`\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { NullablePhoneNumberSchema } from \"@nakanoaas/notion-valibot-utils\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * Phone: NullablePhoneNumberSchema,\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.Phone: string | null\n * ```\n */\nexport const NullablePhoneNumberSchema = v.pipe(\n\tv.object({\n\t\tphone_number: v.nullable(v.string()),\n\t}),\n\tv.transform((v) => v.phone_number),\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,MAAa,oBAAoBA,QAAE,KAClCA,QAAE,OAAO,EACR,cAAcA,QAAE,OAAO,EACxB,CAAC,GACDA,QAAE,WAAW,MAAM,EAAE,YAAY,CAClC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,MAAa,4BAA4BA,QAAE,KAC1CA,QAAE,OAAO,EACR,cAAcA,QAAE,SAASA,QAAE,OAAO,CAAC,EACpC,CAAC,GACDA,QAAE,WAAW,MAAM,EAAE,YAAY,CAClC"}
|
package/dist/phone-number.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
|
-
|
|
3
2
|
//#region src/phone-number.ts
|
|
4
3
|
/**
|
|
5
4
|
* Schema to extract the `phone_number` property from a Notion page property.
|
|
@@ -61,7 +60,7 @@ const PhoneNumberSchema = v.pipe(v.object({ phone_number: v.string() }), v.trans
|
|
|
61
60
|
* ```
|
|
62
61
|
*/
|
|
63
62
|
const NullablePhoneNumberSchema = v.pipe(v.object({ phone_number: v.nullable(v.string()) }), v.transform((v) => v.phone_number));
|
|
64
|
-
|
|
65
63
|
//#endregion
|
|
66
64
|
export { NullablePhoneNumberSchema, PhoneNumberSchema };
|
|
65
|
+
|
|
67
66
|
//# sourceMappingURL=phone-number.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phone-number.mjs","names":[],"sources":["../src/phone-number.ts"],"sourcesContent":["import * as v from \"valibot\";\n\n/**\n * Schema to extract the `phone_number` property from a Notion page property.\n *\n * **Input:**\n * ```\n * {\n * phone_number: string;\n * }\n * ```\n *\n * **Output:** `string`\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { PhoneNumberSchema } from \"@nakanoaas/notion-valibot-utils\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * Phone: PhoneNumberSchema,\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.Phone: string\n * ```\n */\nexport const PhoneNumberSchema = v.pipe(\n\tv.object({\n\t\tphone_number: v.string(),\n\t}),\n\tv.transform((v) => v.phone_number),\n);\n\n/**\n * Schema to extract the `phone_number` property from a Notion page property or `null`.\n *\n * **Input:**\n * ```\n * {\n * phone_number: string | null;\n * }\n * ```\n *\n * **Output:** `string | null`\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { NullablePhoneNumberSchema } from \"@nakanoaas/notion-valibot-utils\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * Phone: NullablePhoneNumberSchema,\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.Phone: string | null\n * ```\n */\nexport const NullablePhoneNumberSchema = v.pipe(\n\tv.object({\n\t\tphone_number: v.nullable(v.string()),\n\t}),\n\tv.transform((v) => v.phone_number),\n);\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"phone-number.mjs","names":[],"sources":["../src/phone-number.ts"],"sourcesContent":["import * as v from \"valibot\";\n\n/**\n * Schema to extract the `phone_number` property from a Notion page property.\n *\n * **Input:**\n * ```\n * {\n * phone_number: string;\n * }\n * ```\n *\n * **Output:** `string`\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { PhoneNumberSchema } from \"@nakanoaas/notion-valibot-utils\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * Phone: PhoneNumberSchema,\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.Phone: string\n * ```\n */\nexport const PhoneNumberSchema = v.pipe(\n\tv.object({\n\t\tphone_number: v.string(),\n\t}),\n\tv.transform((v) => v.phone_number),\n);\n\n/**\n * Schema to extract the `phone_number` property from a Notion page property or `null`.\n *\n * **Input:**\n * ```\n * {\n * phone_number: string | null;\n * }\n * ```\n *\n * **Output:** `string | null`\n *\n * @example\n * ```ts\n * import * as v from \"valibot\";\n * import { NullablePhoneNumberSchema } from \"@nakanoaas/notion-valibot-utils\";\n *\n * const PageSchema = v.object({\n * id: v.string(),\n * properties: v.object({\n * Phone: NullablePhoneNumberSchema,\n * }),\n * });\n *\n * const page = await notion.pages.retrieve({ page_id: \"...\" });\n * const parsed = v.parse(PageSchema, page);\n * // parsed.properties.Phone: string | null\n * ```\n */\nexport const NullablePhoneNumberSchema = v.pipe(\n\tv.object({\n\t\tphone_number: v.nullable(v.string()),\n\t}),\n\tv.transform((v) => v.phone_number),\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,MAAa,oBAAoB,EAAE,KAClC,EAAE,OAAO,EACR,cAAc,EAAE,OAAO,EACxB,CAAC,GACD,EAAE,WAAW,MAAM,EAAE,YAAY,CAClC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,MAAa,4BAA4B,EAAE,KAC1C,EAAE,OAAO,EACR,cAAc,EAAE,SAAS,EAAE,OAAO,CAAC,EACpC,CAAC,GACD,EAAE,WAAW,MAAM,EAAE,YAAY,CAClC"}
|
package/dist/place.cjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
const require_runtime = require(
|
|
1
|
+
const require_runtime = require("./_virtual/_rolldown/runtime.cjs");
|
|
2
2
|
let valibot = require("valibot");
|
|
3
|
-
valibot = require_runtime.__toESM(valibot);
|
|
4
|
-
|
|
3
|
+
valibot = require_runtime.__toESM(valibot, 1);
|
|
5
4
|
//#region src/place.ts
|
|
6
5
|
/**
|
|
7
6
|
* Schema for a Notion place object structure.
|
|
@@ -139,8 +138,8 @@ const PlaceSchema = valibot.pipe(valibot.object({ place: PlaceObjectSchema }), v
|
|
|
139
138
|
* ```
|
|
140
139
|
*/
|
|
141
140
|
const NullablePlaceSchema = valibot.pipe(valibot.object({ place: valibot.nullable(PlaceObjectSchema) }), valibot.transform((v) => v.place));
|
|
142
|
-
|
|
143
141
|
//#endregion
|
|
144
142
|
exports.NullablePlaceSchema = NullablePlaceSchema;
|
|
145
143
|
exports.PlaceSchema = PlaceSchema;
|
|
144
|
+
|
|
146
145
|
//# sourceMappingURL=place.cjs.map
|