@nakanoaas/notion-valibot-schema 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +128 -0
  3. package/dist/_virtual/rolldown_runtime.cjs +29 -0
  4. package/dist/checkbox.cjs +10 -0
  5. package/dist/checkbox.cjs.map +1 -0
  6. package/dist/checkbox.d.cts +11 -0
  7. package/dist/checkbox.d.mts +11 -0
  8. package/dist/checkbox.mjs +8 -0
  9. package/dist/checkbox.mjs.map +1 -0
  10. package/dist/created-by.cjs +13 -0
  11. package/dist/created-by.cjs.map +1 -0
  12. package/dist/created-by.d.cts +36 -0
  13. package/dist/created-by.d.mts +36 -0
  14. package/dist/created-by.mjs +10 -0
  15. package/dist/created-by.mjs.map +1 -0
  16. package/dist/created-time.cjs +10 -0
  17. package/dist/created-time.cjs.map +1 -0
  18. package/dist/created-time.d.cts +11 -0
  19. package/dist/created-time.d.mts +11 -0
  20. package/dist/created-time.mjs +8 -0
  21. package/dist/created-time.mjs.map +1 -0
  22. package/dist/date.cjs +28 -0
  23. package/dist/date.cjs.map +1 -0
  24. package/dist/date.d.cts +52 -0
  25. package/dist/date.d.mts +52 -0
  26. package/dist/date.mjs +23 -0
  27. package/dist/date.mjs.map +1 -0
  28. package/dist/email.cjs +12 -0
  29. package/dist/email.cjs.map +1 -0
  30. package/dist/email.d.cts +16 -0
  31. package/dist/email.d.mts +16 -0
  32. package/dist/email.mjs +9 -0
  33. package/dist/email.mjs.map +1 -0
  34. package/dist/files.cjs +16 -0
  35. package/dist/files.cjs.map +1 -0
  36. package/dist/files.d.cts +31 -0
  37. package/dist/files.d.mts +31 -0
  38. package/dist/files.mjs +14 -0
  39. package/dist/files.mjs.map +1 -0
  40. package/dist/formula.cjs +12 -0
  41. package/dist/formula.cjs.map +1 -0
  42. package/dist/formula.d.cts +49 -0
  43. package/dist/formula.d.mts +49 -0
  44. package/dist/formula.mjs +10 -0
  45. package/dist/formula.mjs.map +1 -0
  46. package/dist/index.cjs +64 -0
  47. package/dist/index.d.cts +23 -0
  48. package/dist/index.d.mts +23 -0
  49. package/dist/index.mjs +24 -0
  50. package/dist/last-edited-by.cjs +13 -0
  51. package/dist/last-edited-by.cjs.map +1 -0
  52. package/dist/last-edited-by.d.cts +32 -0
  53. package/dist/last-edited-by.d.mts +32 -0
  54. package/dist/last-edited-by.mjs +10 -0
  55. package/dist/last-edited-by.mjs.map +1 -0
  56. package/dist/last-edited-time.cjs +10 -0
  57. package/dist/last-edited-time.cjs.map +1 -0
  58. package/dist/last-edited-time.d.cts +11 -0
  59. package/dist/last-edited-time.d.mts +11 -0
  60. package/dist/last-edited-time.mjs +8 -0
  61. package/dist/last-edited-time.mjs.map +1 -0
  62. package/dist/multi-select.cjs +12 -0
  63. package/dist/multi-select.cjs.map +1 -0
  64. package/dist/multi-select.d.cts +37 -0
  65. package/dist/multi-select.d.mts +37 -0
  66. package/dist/multi-select.mjs +10 -0
  67. package/dist/multi-select.mjs.map +1 -0
  68. package/dist/number.cjs +12 -0
  69. package/dist/number.cjs.map +1 -0
  70. package/dist/number.d.cts +16 -0
  71. package/dist/number.d.mts +16 -0
  72. package/dist/number.mjs +9 -0
  73. package/dist/number.mjs.map +1 -0
  74. package/dist/people.cjs +20 -0
  75. package/dist/people.cjs.map +1 -0
  76. package/dist/people.d.cts +28 -0
  77. package/dist/people.d.mts +28 -0
  78. package/dist/people.mjs +17 -0
  79. package/dist/people.mjs.map +1 -0
  80. package/dist/phone-number.cjs +12 -0
  81. package/dist/phone-number.cjs.map +1 -0
  82. package/dist/phone-number.d.cts +16 -0
  83. package/dist/phone-number.d.mts +16 -0
  84. package/dist/phone-number.mjs +9 -0
  85. package/dist/phone-number.mjs.map +1 -0
  86. package/dist/place.cjs +18 -0
  87. package/dist/place.cjs.map +1 -0
  88. package/dist/place.d.cts +46 -0
  89. package/dist/place.d.mts +46 -0
  90. package/dist/place.mjs +15 -0
  91. package/dist/place.mjs.map +1 -0
  92. package/dist/relation.cjs +10 -0
  93. package/dist/relation.cjs.map +1 -0
  94. package/dist/relation.d.cts +15 -0
  95. package/dist/relation.d.mts +15 -0
  96. package/dist/relation.mjs +8 -0
  97. package/dist/relation.mjs.map +1 -0
  98. package/dist/rollup.cjs +43 -0
  99. package/dist/rollup.cjs.map +1 -0
  100. package/dist/rollup.d.cts +79 -0
  101. package/dist/rollup.d.mts +79 -0
  102. package/dist/rollup.mjs +37 -0
  103. package/dist/rollup.mjs.map +1 -0
  104. package/dist/select.cjs +16 -0
  105. package/dist/select.cjs.map +1 -0
  106. package/dist/select.d.cts +68 -0
  107. package/dist/select.d.mts +68 -0
  108. package/dist/select.mjs +13 -0
  109. package/dist/select.mjs.map +1 -0
  110. package/dist/status.cjs +16 -0
  111. package/dist/status.cjs.map +1 -0
  112. package/dist/status.d.cts +68 -0
  113. package/dist/status.d.mts +68 -0
  114. package/dist/status.mjs +13 -0
  115. package/dist/status.mjs.map +1 -0
  116. package/dist/text.cjs +13 -0
  117. package/dist/text.cjs.map +1 -0
  118. package/dist/text.d.cts +24 -0
  119. package/dist/text.d.mts +24 -0
  120. package/dist/text.mjs +10 -0
  121. package/dist/text.mjs.map +1 -0
  122. package/dist/unique-id.cjs +13 -0
  123. package/dist/unique-id.cjs.map +1 -0
  124. package/dist/unique-id.d.cts +20 -0
  125. package/dist/unique-id.d.mts +20 -0
  126. package/dist/unique-id.mjs +11 -0
  127. package/dist/unique-id.mjs.map +1 -0
  128. package/dist/url.cjs +12 -0
  129. package/dist/url.cjs.map +1 -0
  130. package/dist/url.d.cts +16 -0
  131. package/dist/url.d.mts +16 -0
  132. package/dist/url.mjs +9 -0
  133. package/dist/url.mjs.map +1 -0
  134. package/dist/verification.cjs +26 -0
  135. package/dist/verification.cjs.map +1 -0
  136. package/dist/verification.d.cts +112 -0
  137. package/dist/verification.d.mts +112 -0
  138. package/dist/verification.mjs +23 -0
  139. package/dist/verification.mjs.map +1 -0
  140. package/package.json +56 -0
@@ -0,0 +1,112 @@
1
+ import * as v from "valibot";
2
+
3
+ //#region src/verification.d.ts
4
+ declare const VerificationSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
5
+ readonly verification: v.VariantSchema<"state", [v.ObjectSchema<{
6
+ readonly state: v.LiteralSchema<"unverified", undefined>;
7
+ readonly date: v.NullSchema<undefined>;
8
+ readonly verified_by: v.NullSchema<undefined>;
9
+ }, undefined>, v.ObjectSchema<{
10
+ readonly state: v.UnionSchema<[v.LiteralSchema<"verified", undefined>, v.LiteralSchema<"expired", undefined>], undefined>;
11
+ readonly date: v.NullableSchema<v.ObjectSchema<{
12
+ readonly start: v.StringSchema<undefined>;
13
+ readonly end: v.NullableSchema<v.StringSchema<undefined>, undefined>;
14
+ readonly time_zone: v.NullableSchema<v.StringSchema<undefined>, undefined>;
15
+ }, undefined>, undefined>;
16
+ readonly verified_by: v.NullableSchema<v.ObjectSchema<{
17
+ readonly id: v.StringSchema<undefined>;
18
+ readonly object: v.PicklistSchema<["user", "bot", "group"], undefined>;
19
+ readonly name: v.NullishSchema<v.StringSchema<undefined>, null>;
20
+ }, undefined>, undefined>;
21
+ }, undefined>], undefined>;
22
+ }, undefined>, v.TransformAction<{
23
+ verification: {
24
+ state: "unverified";
25
+ date: null;
26
+ verified_by: null;
27
+ } | {
28
+ state: "verified" | "expired";
29
+ date: {
30
+ start: string;
31
+ end: string | null;
32
+ time_zone: string | null;
33
+ } | null;
34
+ verified_by: {
35
+ id: string;
36
+ object: "user" | "bot" | "group";
37
+ name: string | null;
38
+ } | null;
39
+ };
40
+ }, {
41
+ state: "unverified";
42
+ date: null;
43
+ verified_by: null;
44
+ } | {
45
+ state: "verified" | "expired";
46
+ date: {
47
+ start: string;
48
+ end: string | null;
49
+ time_zone: string | null;
50
+ } | null;
51
+ verified_by: {
52
+ id: string;
53
+ object: "user" | "bot" | "group";
54
+ name: string | null;
55
+ } | null;
56
+ }>]>;
57
+ declare const NullableVerificationSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
58
+ readonly verification: v.NullableSchema<v.VariantSchema<"state", [v.ObjectSchema<{
59
+ readonly state: v.LiteralSchema<"unverified", undefined>;
60
+ readonly date: v.NullSchema<undefined>;
61
+ readonly verified_by: v.NullSchema<undefined>;
62
+ }, undefined>, v.ObjectSchema<{
63
+ readonly state: v.UnionSchema<[v.LiteralSchema<"verified", undefined>, v.LiteralSchema<"expired", undefined>], undefined>;
64
+ readonly date: v.NullableSchema<v.ObjectSchema<{
65
+ readonly start: v.StringSchema<undefined>;
66
+ readonly end: v.NullableSchema<v.StringSchema<undefined>, undefined>;
67
+ readonly time_zone: v.NullableSchema<v.StringSchema<undefined>, undefined>;
68
+ }, undefined>, undefined>;
69
+ readonly verified_by: v.NullableSchema<v.ObjectSchema<{
70
+ readonly id: v.StringSchema<undefined>;
71
+ readonly object: v.PicklistSchema<["user", "bot", "group"], undefined>;
72
+ readonly name: v.NullishSchema<v.StringSchema<undefined>, null>;
73
+ }, undefined>, undefined>;
74
+ }, undefined>], undefined>, undefined>;
75
+ }, undefined>, v.TransformAction<{
76
+ verification: {
77
+ state: "unverified";
78
+ date: null;
79
+ verified_by: null;
80
+ } | {
81
+ state: "verified" | "expired";
82
+ date: {
83
+ start: string;
84
+ end: string | null;
85
+ time_zone: string | null;
86
+ } | null;
87
+ verified_by: {
88
+ id: string;
89
+ object: "user" | "bot" | "group";
90
+ name: string | null;
91
+ } | null;
92
+ } | null;
93
+ }, {
94
+ state: "unverified";
95
+ date: null;
96
+ verified_by: null;
97
+ } | {
98
+ state: "verified" | "expired";
99
+ date: {
100
+ start: string;
101
+ end: string | null;
102
+ time_zone: string | null;
103
+ } | null;
104
+ verified_by: {
105
+ id: string;
106
+ object: "user" | "bot" | "group";
107
+ name: string | null;
108
+ } | null;
109
+ } | null>]>;
110
+ //#endregion
111
+ export { NullableVerificationSchema, VerificationSchema };
112
+ //# sourceMappingURL=verification.d.cts.map
@@ -0,0 +1,112 @@
1
+ import * as v from "valibot";
2
+
3
+ //#region src/verification.d.ts
4
+ declare const VerificationSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
5
+ readonly verification: v.VariantSchema<"state", [v.ObjectSchema<{
6
+ readonly state: v.LiteralSchema<"unverified", undefined>;
7
+ readonly date: v.NullSchema<undefined>;
8
+ readonly verified_by: v.NullSchema<undefined>;
9
+ }, undefined>, v.ObjectSchema<{
10
+ readonly state: v.UnionSchema<[v.LiteralSchema<"verified", undefined>, v.LiteralSchema<"expired", undefined>], undefined>;
11
+ readonly date: v.NullableSchema<v.ObjectSchema<{
12
+ readonly start: v.StringSchema<undefined>;
13
+ readonly end: v.NullableSchema<v.StringSchema<undefined>, undefined>;
14
+ readonly time_zone: v.NullableSchema<v.StringSchema<undefined>, undefined>;
15
+ }, undefined>, undefined>;
16
+ readonly verified_by: v.NullableSchema<v.ObjectSchema<{
17
+ readonly id: v.StringSchema<undefined>;
18
+ readonly object: v.PicklistSchema<["user", "bot", "group"], undefined>;
19
+ readonly name: v.NullishSchema<v.StringSchema<undefined>, null>;
20
+ }, undefined>, undefined>;
21
+ }, undefined>], undefined>;
22
+ }, undefined>, v.TransformAction<{
23
+ verification: {
24
+ state: "unverified";
25
+ date: null;
26
+ verified_by: null;
27
+ } | {
28
+ state: "verified" | "expired";
29
+ date: {
30
+ start: string;
31
+ end: string | null;
32
+ time_zone: string | null;
33
+ } | null;
34
+ verified_by: {
35
+ id: string;
36
+ object: "user" | "bot" | "group";
37
+ name: string | null;
38
+ } | null;
39
+ };
40
+ }, {
41
+ state: "unverified";
42
+ date: null;
43
+ verified_by: null;
44
+ } | {
45
+ state: "verified" | "expired";
46
+ date: {
47
+ start: string;
48
+ end: string | null;
49
+ time_zone: string | null;
50
+ } | null;
51
+ verified_by: {
52
+ id: string;
53
+ object: "user" | "bot" | "group";
54
+ name: string | null;
55
+ } | null;
56
+ }>]>;
57
+ declare const NullableVerificationSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
58
+ readonly verification: v.NullableSchema<v.VariantSchema<"state", [v.ObjectSchema<{
59
+ readonly state: v.LiteralSchema<"unverified", undefined>;
60
+ readonly date: v.NullSchema<undefined>;
61
+ readonly verified_by: v.NullSchema<undefined>;
62
+ }, undefined>, v.ObjectSchema<{
63
+ readonly state: v.UnionSchema<[v.LiteralSchema<"verified", undefined>, v.LiteralSchema<"expired", undefined>], undefined>;
64
+ readonly date: v.NullableSchema<v.ObjectSchema<{
65
+ readonly start: v.StringSchema<undefined>;
66
+ readonly end: v.NullableSchema<v.StringSchema<undefined>, undefined>;
67
+ readonly time_zone: v.NullableSchema<v.StringSchema<undefined>, undefined>;
68
+ }, undefined>, undefined>;
69
+ readonly verified_by: v.NullableSchema<v.ObjectSchema<{
70
+ readonly id: v.StringSchema<undefined>;
71
+ readonly object: v.PicklistSchema<["user", "bot", "group"], undefined>;
72
+ readonly name: v.NullishSchema<v.StringSchema<undefined>, null>;
73
+ }, undefined>, undefined>;
74
+ }, undefined>], undefined>, undefined>;
75
+ }, undefined>, v.TransformAction<{
76
+ verification: {
77
+ state: "unverified";
78
+ date: null;
79
+ verified_by: null;
80
+ } | {
81
+ state: "verified" | "expired";
82
+ date: {
83
+ start: string;
84
+ end: string | null;
85
+ time_zone: string | null;
86
+ } | null;
87
+ verified_by: {
88
+ id: string;
89
+ object: "user" | "bot" | "group";
90
+ name: string | null;
91
+ } | null;
92
+ } | null;
93
+ }, {
94
+ state: "unverified";
95
+ date: null;
96
+ verified_by: null;
97
+ } | {
98
+ state: "verified" | "expired";
99
+ date: {
100
+ start: string;
101
+ end: string | null;
102
+ time_zone: string | null;
103
+ } | null;
104
+ verified_by: {
105
+ id: string;
106
+ object: "user" | "bot" | "group";
107
+ name: string | null;
108
+ } | null;
109
+ } | null>]>;
110
+ //#endregion
111
+ export { NullableVerificationSchema, VerificationSchema };
112
+ //# sourceMappingURL=verification.d.mts.map
@@ -0,0 +1,23 @@
1
+ import { PersonSchema } from "./people.mjs";
2
+ import * as v from "valibot";
3
+
4
+ //#region src/verification.ts
5
+ const InnerVerificationSchema = v.variant("state", [v.object({
6
+ state: v.literal("unverified"),
7
+ date: v.null_(),
8
+ verified_by: v.null_()
9
+ }), v.object({
10
+ state: v.union([v.literal("verified"), v.literal("expired")]),
11
+ date: v.nullable(v.object({
12
+ start: v.string(),
13
+ end: v.nullable(v.string()),
14
+ time_zone: v.nullable(v.string())
15
+ })),
16
+ verified_by: v.nullable(PersonSchema)
17
+ })]);
18
+ const VerificationSchema = v.pipe(v.object({ verification: InnerVerificationSchema }), v.transform((v$1) => v$1.verification));
19
+ const NullableVerificationSchema = v.pipe(v.object({ verification: v.nullable(InnerVerificationSchema) }), v.transform((v$1) => v$1.verification));
20
+
21
+ //#endregion
22
+ export { NullableVerificationSchema, VerificationSchema };
23
+ //# sourceMappingURL=verification.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verification.mjs","names":["v"],"sources":["../src/verification.ts"],"sourcesContent":["import * as v from \"valibot\";\n\nimport { PersonSchema } from \"./people\";\n\nconst InnerVerificationSchema = v.variant(\"state\", [\n\tv.object({\n\t\tstate: v.literal(\"unverified\"),\n\t\tdate: v.null_(),\n\t\tverified_by: v.null_(),\n\t}),\n\tv.object({\n\t\tstate: v.union([v.literal(\"verified\"), v.literal(\"expired\")]),\n\t\tdate: v.nullable(\n\t\t\tv.object({\n\t\t\t\tstart: v.string(),\n\t\t\t\tend: v.nullable(v.string()),\n\t\t\t\ttime_zone: v.nullable(v.string()),\n\t\t\t}),\n\t\t),\n\t\tverified_by: v.nullable(PersonSchema),\n\t}),\n]);\n\nexport const VerificationSchema = v.pipe(\n\tv.object({\n\t\tverification: InnerVerificationSchema,\n\t}),\n\tv.transform((v) => v.verification),\n);\n\nexport const NullableVerificationSchema = v.pipe(\n\tv.object({\n\t\tverification: v.nullable(InnerVerificationSchema),\n\t}),\n\tv.transform((v) => v.verification),\n);\n"],"mappings":";;;;AAIA,MAAM,0BAA0B,EAAE,QAAQ,SAAS,CAClD,EAAE,OAAO;CACR,OAAO,EAAE,QAAQ,aAAa;CAC9B,MAAM,EAAE,OAAO;CACf,aAAa,EAAE,OAAO;CACtB,CAAC,EACF,EAAE,OAAO;CACR,OAAO,EAAE,MAAM,CAAC,EAAE,QAAQ,WAAW,EAAE,EAAE,QAAQ,UAAU,CAAC,CAAC;CAC7D,MAAM,EAAE,SACP,EAAE,OAAO;EACR,OAAO,EAAE,QAAQ;EACjB,KAAK,EAAE,SAAS,EAAE,QAAQ,CAAC;EAC3B,WAAW,EAAE,SAAS,EAAE,QAAQ,CAAC;EACjC,CAAC,CACF;CACD,aAAa,EAAE,SAAS,aAAa;CACrC,CAAC,CACF,CAAC;AAEF,MAAa,qBAAqB,EAAE,KACnC,EAAE,OAAO,EACR,cAAc,yBACd,CAAC,EACF,EAAE,WAAW,QAAMA,IAAE,aAAa,CAClC;AAED,MAAa,6BAA6B,EAAE,KAC3C,EAAE,OAAO,EACR,cAAc,EAAE,SAAS,wBAAwB,EACjD,CAAC,EACF,EAAE,WAAW,QAAMA,IAAE,aAAa,CAClC"}
package/package.json ADDED
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "@nakanoaas/notion-valibot-schema",
3
+ "version": "0.0.1",
4
+ "description": "A collection of valibot schemas for Notion API",
5
+ "author": "Nakano as a Service",
6
+ "license": "MIT",
7
+ "type": "module",
8
+ "sideEffects": false,
9
+ "publishConfig": {
10
+ "access": "public",
11
+ "provenance": false
12
+ },
13
+ "homepage": "https://github.com/nakanoasaservice/notion-valibot-schema",
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/nakanoasaservice/notion-valibot-schema.git"
17
+ },
18
+ "bugs": {
19
+ "url": "https://github.com/nakanoasaservice/notion-valibot-schema/issues"
20
+ },
21
+ "keywords": [
22
+ "notion",
23
+ "valibot",
24
+ "schema"
25
+ ],
26
+ "main": "./dist/index.cjs",
27
+ "module": "./dist/index.mjs",
28
+ "types": "./dist/index.d.cts",
29
+ "exports": {
30
+ ".": {
31
+ "import": "./dist/index.mjs",
32
+ "require": "./dist/index.cjs"
33
+ },
34
+ "./package.json": "./package.json"
35
+ },
36
+ "files": [
37
+ "dist"
38
+ ],
39
+ "peerDependencies": {
40
+ "valibot": "^1.2.0"
41
+ },
42
+ "devDependencies": {
43
+ "@biomejs/biome": "^2.3.7",
44
+ "@notionhq/client": "^5.6.0",
45
+ "@types/node": "^24.10.1",
46
+ "tsdown": "^0.16.7",
47
+ "typescript": "^5.9.3",
48
+ "vitest": "~4.0.16"
49
+ },
50
+ "scripts": {
51
+ "build": "tsdown",
52
+ "check:fix": "biome check --write",
53
+ "check": "biome check",
54
+ "test": "vitest --typecheck"
55
+ }
56
+ }