@tktb-tess/my-zod-schema 0.1.4 → 0.2.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/dist/bundle.js CHANGED
@@ -1,186 +1,267 @@
1
- import e from "zod";
2
- const c = {
3
- from: (n = "", r = "", t) => ({
4
- name: n,
5
- message: r,
6
- cause: t
7
- })
8
- }, $ = (n, r) => {
9
- try {
10
- const t = r.safeParse(JSON.parse(n));
11
- return t.success ? {
12
- success: !0,
13
- data: t.data
14
- } : {
15
- success: !1,
16
- error: t.error
17
- };
18
- } catch (t) {
19
- return {
20
- success: !1,
21
- error: t instanceof Error ? c.from(t.name, t.message, t.cause) : c.from("UnidentifiedError", "unidentified error", t)
22
- };
23
- }
24
- }, a = e.object({
25
- id: e.int().nonnegative(),
26
- form: e.string()
27
- }).brand(), l = e.object({
28
- title: e.string(),
29
- forms: e.string().array(),
30
- rawForms: e.string().optional()
31
- }), m = e.object({
32
- title: e.string(),
33
- text: e.string()
34
- }), g = e.object({
35
- title: e.string(),
36
- form: e.string()
37
- }), p = e.object({
38
- title: e.string(),
39
- entry: a
40
- }), d = {
41
- entry: a,
42
- translations: l.array(),
43
- tags: e.string().array(),
44
- contents: m.array(),
45
- variations: g.array(),
46
- relations: p.array()
47
- }, b = e.object(d), h = e.looseObject(d), S = e.object({
48
- id: e.int().nonnegative(),
49
- sentence: e.string(),
50
- translation: e.string(),
51
- supplement: e.string().optional(),
52
- tags: e.string().array(),
53
- words: e.object({
54
- id: e.int().nonnegative()
1
+ import t from "zod";
2
+ const e = t.object({
3
+ id: t.int().nonnegative(),
4
+ form: t.string()
5
+ }).brand(), i = t.object({
6
+ title: t.string(),
7
+ forms: t.string().array(),
8
+ rawForms: t.string().optional()
9
+ }), s = t.object({
10
+ title: t.string(),
11
+ text: t.string()
12
+ }), c = t.object({
13
+ title: t.string(),
14
+ form: t.string()
15
+ }), l = t.object({
16
+ title: t.string(),
17
+ entry: e
18
+ }), m = {
19
+ entry: e,
20
+ translations: i.array(),
21
+ tags: t.string().array(),
22
+ contents: s.array(),
23
+ variations: c.array(),
24
+ relations: l.array()
25
+ }, g = t.object(m), p = t.looseObject(m), d = t.object({
26
+ id: t.int().nonnegative(),
27
+ sentence: t.string(),
28
+ translation: t.string(),
29
+ supplement: t.string().optional(),
30
+ tags: t.string().array(),
31
+ words: t.object({
32
+ id: t.int().nonnegative()
55
33
  }).array(),
56
- offer: e.object({
57
- catalog: e.string(),
58
- number: e.int().nonnegative()
34
+ offer: t.object({
35
+ catalog: t.string(),
36
+ number: t.int().nonnegative()
59
37
  }).optional()
60
- }), u = e.object({
61
- explanation: e.string().optional(),
62
- punctuations: e.string().array(),
63
- ignoredPattern: e.string().optional(),
64
- pronunciationTitle: e.string(),
65
- enableMarkdown: e.boolean()
66
- }), f = e.object({
67
- version: e.literal(1).optional(),
68
- words: b.array()
69
- }).brand(), o = e.looseObject({
70
- version: e.literal(2),
71
- words: h.array()
72
- }).brand(), w = e.discriminatedUnion("version", [
73
- f,
74
- o
75
- ]), z = o.extend({
76
- examples: S.array(),
77
- zpdicOnline: u,
78
- snoj: e.string().optional(),
79
- zatlin: e.string().optional()
80
- }), k = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
38
+ }), b = t.object({
39
+ explanation: t.string().optional(),
40
+ punctuations: t.string().array(),
41
+ ignoredPattern: t.string().optional(),
42
+ pronunciationTitle: t.string(),
43
+ enableMarkdown: t.boolean()
44
+ }), y = t.object({
45
+ version: t.literal(1).optional(),
46
+ words: g.array()
47
+ }).brand(), n = t.looseObject({
48
+ version: t.literal(2),
49
+ words: p.array()
50
+ }).brand(), x = t.discriminatedUnion("version", [
51
+ y,
52
+ n
53
+ ]), O = n.extend({
54
+ examples: d.array(),
55
+ zpdicOnline: b,
56
+ snoj: t.string().optional(),
57
+ zatlin: t.string().optional()
58
+ }), F = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
81
59
  __proto__: null,
82
- contentSchema: m,
83
- entrySchema: a,
84
- otmjsonSchema: w,
85
- relationSchema: p,
86
- translationSchema: l,
87
- v1Schema: f,
88
- v2Schema: o,
89
- variationSchema: g,
90
- wordv1Schema: b,
91
- wordv2Schema: h,
92
- zpdicConfigSchema: u,
93
- zpdicExampleSchema: S,
94
- zpdicOtmSchema: z
95
- }, Symbol.toStringTag, { value: "Module" })), _ = e.object({
96
- titles: e.string().array(),
97
- names: e.string().array(),
98
- nameString: e.string(),
99
- ignoredPattern: e.string(),
100
- hidden: e.boolean()
101
- }), s = e.string().brand(), E = e.object({
102
- title: e.string(),
103
- text: e.string(),
104
- hidden: e.boolean()
105
- }), P = e.object({
106
- titles: e.string().array(),
107
- form: e.string(),
108
- terms: e.string().array(),
109
- termString: e.string(),
110
- ignoredPattern: e.string()
111
- }), R = e.object({
112
- title: e.string(),
113
- name: e.string(),
114
- pronunciation: e.string()
115
- }), M = e.object({
116
- titles: e.string().array(),
117
- number: e.int().nonnegative(),
118
- name: e.string()
119
- }), j = e.string(), y = e.object({
120
- sentence: e.string(),
121
- supplement: e.string(),
122
- translation: e.string(),
123
- tags: e.string().array(),
124
- words: e.object({
125
- number: e.number()
60
+ contentSchema: s,
61
+ entrySchema: e,
62
+ otmjsonSchema: x,
63
+ relationSchema: l,
64
+ translationSchema: i,
65
+ v1Schema: y,
66
+ v2Schema: n,
67
+ variationSchema: c,
68
+ wordv1Schema: g,
69
+ wordv2Schema: p,
70
+ zpdicConfigSchema: b,
71
+ zpdicExampleSchema: d,
72
+ zpdicOtmSchema: O
73
+ }, Symbol.toStringTag, { value: "Module" })), w = t.object({
74
+ titles: t.string().array(),
75
+ names: t.string().array(),
76
+ nameString: t.string(),
77
+ ignoredPattern: t.string(),
78
+ hidden: t.boolean()
79
+ }), a = t.string().brand(), z = t.object({
80
+ title: t.string(),
81
+ text: t.string(),
82
+ hidden: t.boolean()
83
+ }), _ = t.object({
84
+ titles: t.string().array(),
85
+ form: t.string(),
86
+ terms: t.string().array(),
87
+ termString: t.string(),
88
+ ignoredPattern: t.string()
89
+ }), P = t.object({
90
+ title: t.string(),
91
+ name: t.string(),
92
+ pronunciation: t.string()
93
+ }), T = t.object({
94
+ titles: t.string().array(),
95
+ number: t.int().nonnegative(),
96
+ name: t.string()
97
+ }), S = t.string(), j = t.object({
98
+ sentence: t.string(),
99
+ supplement: t.string(),
100
+ translation: t.string(),
101
+ tags: t.string().array(),
102
+ words: t.object({
103
+ number: t.number()
126
104
  }).array(),
127
- offer: e.object({
128
- catalog: j,
129
- number: e.number()
105
+ offer: t.object({
106
+ catalog: S,
107
+ number: t.number()
130
108
  }).nullable()
131
- }), i = y.extend({
132
- id: s,
133
- number: e.int().nonnegative()
134
- }), v = e.object({
135
- name: e.string(),
136
- pronunciation: e.string(),
137
- equivalents: _.array(),
138
- tags: e.string().array(),
139
- phrases: P.array(),
140
- informations: E.array(),
141
- variations: R.array(),
142
- relations: M.array()
143
- }), T = v.extend({
144
- id: s,
145
- number: e.int().nonnegative()
146
- }), x = T.extend({
147
- examples: i.array()
148
- }), W = e.object({
149
- word: x
150
- }), q = e.object({
151
- words: x.array(),
152
- total: e.int().nonnegative()
153
- }), C = e.object({
154
- examples: i.array(),
155
- total: e.int().nonnegative()
156
- }), D = e.object({
157
- example: i
158
- }), O = e.object({
159
- id: s,
160
- catalog: j,
161
- number: e.int().nonnegative(),
162
- translation: e.string(),
163
- supplement: e.string(),
164
- author: e.string()
165
- }), I = e.object({
166
- exampleOffers: O.array(),
167
- total: e.int().nonnegative()
168
- }), J = e.object({
169
- exampleOffer: O
170
- }), A = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
109
+ }), r = j.extend({
110
+ id: a,
111
+ number: t.int().nonnegative()
112
+ }), h = t.object({
113
+ name: t.string(),
114
+ pronunciation: t.string(),
115
+ equivalents: w.array(),
116
+ tags: t.string().array(),
117
+ phrases: _.array(),
118
+ informations: z.array(),
119
+ variations: P.array(),
120
+ relations: T.array()
121
+ }), u = h.extend({
122
+ id: a,
123
+ number: t.int().nonnegative()
124
+ }), v = u.extend({
125
+ examples: r.array()
126
+ }), E = t.object({
127
+ word: u
128
+ }), R = t.object({
129
+ word: v
130
+ }), I = t.object({
131
+ words: v.array(),
132
+ total: t.int().nonnegative()
133
+ }), N = t.object({
134
+ example: r
135
+ }), $ = t.object({
136
+ examples: r.array(),
137
+ total: t.int().nonnegative()
138
+ }), f = t.object({
139
+ id: a,
140
+ catalog: S,
141
+ number: t.int().nonnegative(),
142
+ translation: t.string(),
143
+ supplement: t.string(),
144
+ author: t.string()
145
+ }), A = t.object({
146
+ exampleOffer: f
147
+ }), C = t.object({
148
+ exampleOffers: f.array(),
149
+ total: t.int().nonnegative()
150
+ }), G = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
151
+ __proto__: null,
152
+ editableExampleSchema: j,
153
+ editableWordSchema: h,
154
+ exOfferResponseSchema: A,
155
+ exResponseSchema: N,
156
+ mExOfferResponseSchema: C,
157
+ mExResponseSchema: $,
158
+ mwweResponseSchema: I,
159
+ wordResponseSchema: E,
160
+ wweResponseSchema: R
161
+ }, Symbol.toStringTag, { value: "Module" })), M = t.object({
162
+ lastUpdate: t.iso.datetime(),
163
+ numberOf: t.int().nonnegative()
164
+ }), D = t.tuple([t.int().nonnegative(), t.int()]).readonly().array(), o = t.object({
165
+ id: t.string(),
166
+ name: t.string().array(),
167
+ colorName: t.tuple([t.string(), t.string()]),
168
+ namedBy: t.string().optional()
169
+ }), U = t.discriminatedUnion("commaType", [
170
+ o.extend({
171
+ commaType: t.literal("rational"),
172
+ monzo: D
173
+ }),
174
+ o.extend({
175
+ commaType: t.literal("irrational"),
176
+ ratio: t.string(),
177
+ cents: t.number().nonnegative()
178
+ })
179
+ ]), L = t.object({
180
+ metadata: M,
181
+ commas: U.array()
182
+ }), H = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
183
+ __proto__: null,
184
+ commaDataSchema: L
185
+ }, Symbol.toStringTag, { value: "Module" })), J = t.union([
186
+ t.literal("INT"),
187
+ t.literal("ART"),
188
+ t.literal("EXP"),
189
+ t.literal("PHI"),
190
+ t.literal("HYP"),
191
+ t.literal("NAT"),
192
+ t.literal("REA"),
193
+ t.literal("IMG"),
194
+ t.literal("CIN"),
195
+ t.literal("CDE"),
196
+ t.literal("GEN"),
197
+ t.literal("SPE"),
198
+ t.literal("SON"),
199
+ t.literal("LIT"),
200
+ t.literal("KIN"),
201
+ t.literal("SER"),
202
+ t.literal("JOK"),
203
+ t.literal("PAV"),
204
+ t.literal("AAV"),
205
+ t.literal("PWL"),
206
+ t.literal("AWL"),
207
+ t.literal("TOL"),
208
+ t.literal("PRI"),
209
+ t.literal("PUB"),
210
+ t.literal("FIX")
211
+ ]), W = t.object({
212
+ datasize: t.tuple([t.int().nonnegative(), t.int().nonnegative()]),
213
+ title: t.string(),
214
+ author: t.string().array(),
215
+ createdDate: t.iso.datetime(),
216
+ lastUpdate: t.iso.datetime(),
217
+ jsonLastUpdate: t.iso.datetime(),
218
+ license: t.object({
219
+ name: t.string(),
220
+ content: t.string()
221
+ }),
222
+ advanced: t.int().nonnegative(),
223
+ label: t.string().array(),
224
+ type: t.string().array()
225
+ }), k = t.object({
226
+ id: t.string(),
227
+ messier: t.unknown().optional(),
228
+ name: t.string().array(),
229
+ kanji: t.string().array(),
230
+ desc: t.string().array(),
231
+ creator: t.string().array(),
232
+ period: t.string().optional(),
233
+ site: t.object({
234
+ name: t.string().optional(),
235
+ url: t.url()
236
+ }).array().optional(),
237
+ twitter: t.string().array().optional(),
238
+ dict: t.string().array().optional(),
239
+ grammar: t.string().array().optional(),
240
+ world: t.string().array().optional(),
241
+ category: t.object({
242
+ name: t.string(),
243
+ content: t.string().optional()
244
+ }).array().optional(),
245
+ moyune: J.array().optional(),
246
+ clav3: t.object({
247
+ dialect: t.string().regex(/^(?:[a-z]{2}|~)$/),
248
+ language: t.string().regex(/^[a-z]{2}$/),
249
+ family: t.string().regex(/^(?:[a-z]{3}|~)$/),
250
+ creator: t.string().regex(/^[a-z]{3}$/)
251
+ }).optional(),
252
+ part: t.string().optional(),
253
+ example: t.string().array().optional(),
254
+ script: t.string().array().optional()
255
+ }), B = t.object({
256
+ metadata: W,
257
+ contents: k.array()
258
+ }).brand(), K = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
171
259
  __proto__: null,
172
- editableExampleSchema: y,
173
- editableWordSchema: v,
174
- exampleOfferResponseSchema: J,
175
- exampleOffersResponseSchema: I,
176
- exampleResponseSchema: D,
177
- examplesResponseSchema: C,
178
- wordWithExamplesResponseSchema: W,
179
- wordsResponseSchema: q
260
+ schema: B
180
261
  }, Symbol.toStringTag, { value: "Module" }));
181
262
  export {
182
- c as MiscError,
183
- k as OTMJSON,
184
- A as ZpDIC,
185
- $ as parseAndValidate
263
+ H as Comma,
264
+ K as CotecJSON,
265
+ F as OTMJSON,
266
+ G as ZpDIC
186
267
  };
@@ -0,0 +1,49 @@
1
+ import { default as z } from 'zod';
2
+ declare const metadataSchema: z.ZodObject<{
3
+ lastUpdate: z.ZodISODateTime;
4
+ numberOf: z.ZodInt;
5
+ }, z.core.$strip>;
6
+ export type Metadata = z.infer<typeof metadataSchema>;
7
+ declare const monzoSchema: z.ZodArray<z.ZodReadonly<z.ZodTuple<[z.ZodInt, z.ZodInt], null>>>;
8
+ export type Monzo = z.infer<typeof monzoSchema>;
9
+ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
10
+ id: z.ZodString;
11
+ name: z.ZodArray<z.ZodString>;
12
+ colorName: z.ZodTuple<[z.ZodString, z.ZodString], null>;
13
+ namedBy: z.ZodOptional<z.ZodString>;
14
+ commaType: z.ZodLiteral<"rational">;
15
+ monzo: z.ZodArray<z.ZodReadonly<z.ZodTuple<[z.ZodInt, z.ZodInt], null>>>;
16
+ }, z.core.$strip>, z.ZodObject<{
17
+ id: z.ZodString;
18
+ name: z.ZodArray<z.ZodString>;
19
+ colorName: z.ZodTuple<[z.ZodString, z.ZodString], null>;
20
+ namedBy: z.ZodOptional<z.ZodString>;
21
+ commaType: z.ZodLiteral<"irrational">;
22
+ ratio: z.ZodString;
23
+ cents: z.ZodNumber;
24
+ }, z.core.$strip>], "commaType">;
25
+ export type Content = z.infer<typeof contentSchema>;
26
+ export declare const commaDataSchema: z.ZodObject<{
27
+ metadata: z.ZodObject<{
28
+ lastUpdate: z.ZodISODateTime;
29
+ numberOf: z.ZodInt;
30
+ }, z.core.$strip>;
31
+ commas: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
32
+ id: z.ZodString;
33
+ name: z.ZodArray<z.ZodString>;
34
+ colorName: z.ZodTuple<[z.ZodString, z.ZodString], null>;
35
+ namedBy: z.ZodOptional<z.ZodString>;
36
+ commaType: z.ZodLiteral<"rational">;
37
+ monzo: z.ZodArray<z.ZodReadonly<z.ZodTuple<[z.ZodInt, z.ZodInt], null>>>;
38
+ }, z.core.$strip>, z.ZodObject<{
39
+ id: z.ZodString;
40
+ name: z.ZodArray<z.ZodString>;
41
+ colorName: z.ZodTuple<[z.ZodString, z.ZodString], null>;
42
+ namedBy: z.ZodOptional<z.ZodString>;
43
+ commaType: z.ZodLiteral<"irrational">;
44
+ ratio: z.ZodString;
45
+ cents: z.ZodNumber;
46
+ }, z.core.$strip>], "commaType">>;
47
+ }, z.core.$strip>;
48
+ export type CommaData = z.infer<typeof commaDataSchema>;
49
+ export {};
@@ -0,0 +1,102 @@
1
+ import { default as z } from 'zod';
2
+ declare const moyuneClassSchema: z.ZodUnion<readonly [z.ZodLiteral<"INT">, z.ZodLiteral<"ART">, z.ZodLiteral<"EXP">, z.ZodLiteral<"PHI">, z.ZodLiteral<"HYP">, z.ZodLiteral<"NAT">, z.ZodLiteral<"REA">, z.ZodLiteral<"IMG">, z.ZodLiteral<"CIN">, z.ZodLiteral<"CDE">, z.ZodLiteral<"GEN">, z.ZodLiteral<"SPE">, z.ZodLiteral<"SON">, z.ZodLiteral<"LIT">, z.ZodLiteral<"KIN">, z.ZodLiteral<"SER">, z.ZodLiteral<"JOK">, z.ZodLiteral<"PAV">, z.ZodLiteral<"AAV">, z.ZodLiteral<"PWL">, z.ZodLiteral<"AWL">, z.ZodLiteral<"TOL">, z.ZodLiteral<"PRI">, z.ZodLiteral<"PUB">, z.ZodLiteral<"FIX">]>;
3
+ export type MoyuneClass = z.infer<typeof moyuneClassSchema>;
4
+ declare const metadataSchema: z.ZodObject<{
5
+ datasize: z.ZodTuple<[z.ZodInt, z.ZodInt], null>;
6
+ title: z.ZodString;
7
+ author: z.ZodArray<z.ZodString>;
8
+ createdDate: z.ZodISODateTime;
9
+ lastUpdate: z.ZodISODateTime;
10
+ jsonLastUpdate: z.ZodISODateTime;
11
+ license: z.ZodObject<{
12
+ name: z.ZodString;
13
+ content: z.ZodString;
14
+ }, z.core.$strip>;
15
+ advanced: z.ZodInt;
16
+ label: z.ZodArray<z.ZodString>;
17
+ type: z.ZodArray<z.ZodString>;
18
+ }, z.core.$strip>;
19
+ export type Metadata = z.infer<typeof metadataSchema>;
20
+ declare const contentSchema: z.ZodObject<{
21
+ id: z.ZodString;
22
+ messier: z.ZodOptional<z.ZodUnknown>;
23
+ name: z.ZodArray<z.ZodString>;
24
+ kanji: z.ZodArray<z.ZodString>;
25
+ desc: z.ZodArray<z.ZodString>;
26
+ creator: z.ZodArray<z.ZodString>;
27
+ period: z.ZodOptional<z.ZodString>;
28
+ site: z.ZodOptional<z.ZodArray<z.ZodObject<{
29
+ name: z.ZodOptional<z.ZodString>;
30
+ url: z.ZodURL;
31
+ }, z.core.$strip>>>;
32
+ twitter: z.ZodOptional<z.ZodArray<z.ZodString>>;
33
+ dict: z.ZodOptional<z.ZodArray<z.ZodString>>;
34
+ grammar: z.ZodOptional<z.ZodArray<z.ZodString>>;
35
+ world: z.ZodOptional<z.ZodArray<z.ZodString>>;
36
+ category: z.ZodOptional<z.ZodArray<z.ZodObject<{
37
+ name: z.ZodString;
38
+ content: z.ZodOptional<z.ZodString>;
39
+ }, z.core.$strip>>>;
40
+ moyune: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"INT">, z.ZodLiteral<"ART">, z.ZodLiteral<"EXP">, z.ZodLiteral<"PHI">, z.ZodLiteral<"HYP">, z.ZodLiteral<"NAT">, z.ZodLiteral<"REA">, z.ZodLiteral<"IMG">, z.ZodLiteral<"CIN">, z.ZodLiteral<"CDE">, z.ZodLiteral<"GEN">, z.ZodLiteral<"SPE">, z.ZodLiteral<"SON">, z.ZodLiteral<"LIT">, z.ZodLiteral<"KIN">, z.ZodLiteral<"SER">, z.ZodLiteral<"JOK">, z.ZodLiteral<"PAV">, z.ZodLiteral<"AAV">, z.ZodLiteral<"PWL">, z.ZodLiteral<"AWL">, z.ZodLiteral<"TOL">, z.ZodLiteral<"PRI">, z.ZodLiteral<"PUB">, z.ZodLiteral<"FIX">]>>>;
41
+ clav3: z.ZodOptional<z.ZodObject<{
42
+ dialect: z.ZodString;
43
+ language: z.ZodString;
44
+ family: z.ZodString;
45
+ creator: z.ZodString;
46
+ }, z.core.$strip>>;
47
+ part: z.ZodOptional<z.ZodString>;
48
+ example: z.ZodOptional<z.ZodArray<z.ZodString>>;
49
+ script: z.ZodOptional<z.ZodArray<z.ZodString>>;
50
+ }, z.core.$strip>;
51
+ export type Content = z.infer<typeof contentSchema>;
52
+ declare const cotec_json_brand: unique symbol;
53
+ export declare const schema: z.core.$ZodBranded<z.ZodObject<{
54
+ metadata: z.ZodObject<{
55
+ datasize: z.ZodTuple<[z.ZodInt, z.ZodInt], null>;
56
+ title: z.ZodString;
57
+ author: z.ZodArray<z.ZodString>;
58
+ createdDate: z.ZodISODateTime;
59
+ lastUpdate: z.ZodISODateTime;
60
+ jsonLastUpdate: z.ZodISODateTime;
61
+ license: z.ZodObject<{
62
+ name: z.ZodString;
63
+ content: z.ZodString;
64
+ }, z.core.$strip>;
65
+ advanced: z.ZodInt;
66
+ label: z.ZodArray<z.ZodString>;
67
+ type: z.ZodArray<z.ZodString>;
68
+ }, z.core.$strip>;
69
+ contents: z.ZodArray<z.ZodObject<{
70
+ id: z.ZodString;
71
+ messier: z.ZodOptional<z.ZodUnknown>;
72
+ name: z.ZodArray<z.ZodString>;
73
+ kanji: z.ZodArray<z.ZodString>;
74
+ desc: z.ZodArray<z.ZodString>;
75
+ creator: z.ZodArray<z.ZodString>;
76
+ period: z.ZodOptional<z.ZodString>;
77
+ site: z.ZodOptional<z.ZodArray<z.ZodObject<{
78
+ name: z.ZodOptional<z.ZodString>;
79
+ url: z.ZodURL;
80
+ }, z.core.$strip>>>;
81
+ twitter: z.ZodOptional<z.ZodArray<z.ZodString>>;
82
+ dict: z.ZodOptional<z.ZodArray<z.ZodString>>;
83
+ grammar: z.ZodOptional<z.ZodArray<z.ZodString>>;
84
+ world: z.ZodOptional<z.ZodArray<z.ZodString>>;
85
+ category: z.ZodOptional<z.ZodArray<z.ZodObject<{
86
+ name: z.ZodString;
87
+ content: z.ZodOptional<z.ZodString>;
88
+ }, z.core.$strip>>>;
89
+ moyune: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"INT">, z.ZodLiteral<"ART">, z.ZodLiteral<"EXP">, z.ZodLiteral<"PHI">, z.ZodLiteral<"HYP">, z.ZodLiteral<"NAT">, z.ZodLiteral<"REA">, z.ZodLiteral<"IMG">, z.ZodLiteral<"CIN">, z.ZodLiteral<"CDE">, z.ZodLiteral<"GEN">, z.ZodLiteral<"SPE">, z.ZodLiteral<"SON">, z.ZodLiteral<"LIT">, z.ZodLiteral<"KIN">, z.ZodLiteral<"SER">, z.ZodLiteral<"JOK">, z.ZodLiteral<"PAV">, z.ZodLiteral<"AAV">, z.ZodLiteral<"PWL">, z.ZodLiteral<"AWL">, z.ZodLiteral<"TOL">, z.ZodLiteral<"PRI">, z.ZodLiteral<"PUB">, z.ZodLiteral<"FIX">]>>>;
90
+ clav3: z.ZodOptional<z.ZodObject<{
91
+ dialect: z.ZodString;
92
+ language: z.ZodString;
93
+ family: z.ZodString;
94
+ creator: z.ZodString;
95
+ }, z.core.$strip>>;
96
+ part: z.ZodOptional<z.ZodString>;
97
+ example: z.ZodOptional<z.ZodArray<z.ZodString>>;
98
+ script: z.ZodOptional<z.ZodArray<z.ZodString>>;
99
+ }, z.core.$strip>>;
100
+ }, z.core.$strip>, typeof cotec_json_brand>;
101
+ export type Data = z.infer<typeof schema>;
102
+ export {};
package/dist/main.d.ts CHANGED
@@ -1,3 +1,4 @@
1
- export * from './util';
2
1
  export * as OTMJSON from './otmjson';
3
2
  export * as ZpDIC from './zpdic';
3
+ export * as Comma from './comma-data';
4
+ export * as CotecJSON from './cotec-json';
package/dist/util.d.ts CHANGED
@@ -1,20 +1 @@
1
- import { default as z } from 'zod';
2
- export type Result<T, E> = {
3
- success: true;
4
- data: T;
5
- } | {
6
- success: false;
7
- error: E;
8
- };
9
- declare const misc_err_brand: unique symbol;
10
- type MiscError<T = unknown> = {
11
- readonly name: string;
12
- readonly message: string;
13
- readonly cause?: T;
14
- readonly [misc_err_brand]: unknown;
15
- };
16
- declare const MiscError: {
17
- from: <T = unknown>(name?: string, message?: string, cause?: T) => MiscError<T>;
18
- };
19
- export { MiscError };
20
- export declare const parseAndValidate: <T extends z.ZodType>(json: string, schema: T) => Result<z.infer<T>, z.ZodError<z.infer<T>> | MiscError>;
1
+ export {};
package/dist/zpdic.d.ts CHANGED
@@ -192,7 +192,46 @@ declare const wordWithExamplesSchema: z.ZodObject<{
192
192
  }, z.core.$strip>>;
193
193
  }, z.core.$strip>;
194
194
  export type WordWithExamples = z.infer<typeof wordWithExamplesSchema>;
195
- export declare const wordWithExamplesResponseSchema: z.ZodObject<{
195
+ export declare const wordResponseSchema: z.ZodObject<{
196
+ word: z.ZodObject<{
197
+ name: z.ZodString;
198
+ pronunciation: z.ZodString;
199
+ equivalents: z.ZodArray<z.ZodObject<{
200
+ titles: z.ZodArray<z.ZodString>;
201
+ names: z.ZodArray<z.ZodString>;
202
+ nameString: z.ZodString;
203
+ ignoredPattern: z.ZodString;
204
+ hidden: z.ZodBoolean;
205
+ }, z.core.$strip>>;
206
+ tags: z.ZodArray<z.ZodString>;
207
+ phrases: z.ZodArray<z.ZodObject<{
208
+ titles: z.ZodArray<z.ZodString>;
209
+ form: z.ZodString;
210
+ terms: z.ZodArray<z.ZodString>;
211
+ termString: z.ZodString;
212
+ ignoredPattern: z.ZodString;
213
+ }, z.core.$strip>>;
214
+ informations: z.ZodArray<z.ZodObject<{
215
+ title: z.ZodString;
216
+ text: z.ZodString;
217
+ hidden: z.ZodBoolean;
218
+ }, z.core.$strip>>;
219
+ variations: z.ZodArray<z.ZodObject<{
220
+ title: z.ZodString;
221
+ name: z.ZodString;
222
+ pronunciation: z.ZodString;
223
+ }, z.core.$strip>>;
224
+ relations: z.ZodArray<z.ZodObject<{
225
+ titles: z.ZodArray<z.ZodString>;
226
+ number: z.ZodInt;
227
+ name: z.ZodString;
228
+ }, z.core.$strip>>;
229
+ id: z.core.$ZodBranded<z.ZodString, typeof obj_id_brand>;
230
+ number: z.ZodInt;
231
+ }, z.core.$strip>;
232
+ }, z.core.$strip>;
233
+ export type WordResponse = z.infer<typeof wordResponseSchema>;
234
+ export declare const wweResponseSchema: z.ZodObject<{
196
235
  word: z.ZodObject<{
197
236
  name: z.ZodString;
198
237
  pronunciation: z.ZodString;
@@ -245,8 +284,8 @@ export declare const wordWithExamplesResponseSchema: z.ZodObject<{
245
284
  }, z.core.$strip>>;
246
285
  }, z.core.$strip>;
247
286
  }, z.core.$strip>;
248
- export type WordWithExamplesResponse = z.infer<typeof wordWithExamplesResponseSchema>;
249
- export declare const wordsResponseSchema: z.ZodObject<{
287
+ export type WWEResponse = z.infer<typeof wweResponseSchema>;
288
+ export declare const mwweResponseSchema: z.ZodObject<{
250
289
  words: z.ZodArray<z.ZodObject<{
251
290
  name: z.ZodString;
252
291
  pronunciation: z.ZodString;
@@ -300,9 +339,9 @@ export declare const wordsResponseSchema: z.ZodObject<{
300
339
  }, z.core.$strip>>;
301
340
  total: z.ZodInt;
302
341
  }, z.core.$strip>;
303
- export type WordsResponse = z.infer<typeof wordsResponseSchema>;
304
- export declare const examplesResponseSchema: z.ZodObject<{
305
- examples: z.ZodArray<z.ZodObject<{
342
+ export type MWWEResponse = z.infer<typeof mwweResponseSchema>;
343
+ export declare const exResponseSchema: z.ZodObject<{
344
+ example: z.ZodObject<{
306
345
  sentence: z.ZodString;
307
346
  supplement: z.ZodString;
308
347
  translation: z.ZodString;
@@ -316,12 +355,11 @@ export declare const examplesResponseSchema: z.ZodObject<{
316
355
  }, z.core.$strip>>;
317
356
  id: z.core.$ZodBranded<z.ZodString, typeof obj_id_brand>;
318
357
  number: z.ZodInt;
319
- }, z.core.$strip>>;
320
- total: z.ZodInt;
358
+ }, z.core.$strip>;
321
359
  }, z.core.$strip>;
322
- export type ExamplesResponse = z.infer<typeof examplesResponseSchema>;
323
- export declare const exampleResponseSchema: z.ZodObject<{
324
- example: z.ZodObject<{
360
+ export type ExResponse = z.infer<typeof exResponseSchema>;
361
+ export declare const mExResponseSchema: z.ZodObject<{
362
+ examples: z.ZodArray<z.ZodObject<{
325
363
  sentence: z.ZodString;
326
364
  supplement: z.ZodString;
327
365
  translation: z.ZodString;
@@ -335,9 +373,10 @@ export declare const exampleResponseSchema: z.ZodObject<{
335
373
  }, z.core.$strip>>;
336
374
  id: z.core.$ZodBranded<z.ZodString, typeof obj_id_brand>;
337
375
  number: z.ZodInt;
338
- }, z.core.$strip>;
376
+ }, z.core.$strip>>;
377
+ total: z.ZodInt;
339
378
  }, z.core.$strip>;
340
- export type ExampleResponse = z.infer<typeof exampleResponseSchema>;
379
+ export type MExResponse = z.infer<typeof mExResponseSchema>;
341
380
  declare const exampleOfferSchema: z.ZodObject<{
342
381
  id: z.core.$ZodBranded<z.ZodString, typeof obj_id_brand>;
343
382
  catalog: z.ZodString;
@@ -347,27 +386,27 @@ declare const exampleOfferSchema: z.ZodObject<{
347
386
  author: z.ZodString;
348
387
  }, z.core.$strip>;
349
388
  export type ExampleOffer = z.infer<typeof exampleOfferSchema>;
350
- export declare const exampleOffersResponseSchema: z.ZodObject<{
351
- exampleOffers: z.ZodArray<z.ZodObject<{
389
+ export declare const exOfferResponseSchema: z.ZodObject<{
390
+ exampleOffer: z.ZodObject<{
352
391
  id: z.core.$ZodBranded<z.ZodString, typeof obj_id_brand>;
353
392
  catalog: z.ZodString;
354
393
  number: z.ZodInt;
355
394
  translation: z.ZodString;
356
395
  supplement: z.ZodString;
357
396
  author: z.ZodString;
358
- }, z.core.$strip>>;
359
- total: z.ZodInt;
397
+ }, z.core.$strip>;
360
398
  }, z.core.$strip>;
361
- export type ExampleOffersResponse = z.infer<typeof exampleOffersResponseSchema>;
362
- export declare const exampleOfferResponseSchema: z.ZodObject<{
363
- exampleOffer: z.ZodObject<{
399
+ export type ExOfferResponse = z.infer<typeof exOfferResponseSchema>;
400
+ export declare const mExOfferResponseSchema: z.ZodObject<{
401
+ exampleOffers: z.ZodArray<z.ZodObject<{
364
402
  id: z.core.$ZodBranded<z.ZodString, typeof obj_id_brand>;
365
403
  catalog: z.ZodString;
366
404
  number: z.ZodInt;
367
405
  translation: z.ZodString;
368
406
  supplement: z.ZodString;
369
407
  author: z.ZodString;
370
- }, z.core.$strip>;
408
+ }, z.core.$strip>>;
409
+ total: z.ZodInt;
371
410
  }, z.core.$strip>;
372
- export type ExampleOfferResponse = z.infer<typeof exampleOfferResponseSchema>;
411
+ export type MExOfferResponse = z.infer<typeof mExOfferResponseSchema>;
373
412
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tktb-tess/my-zod-schema",
3
- "version": "0.1.4",
3
+ "version": "0.2.0",
4
4
  "type": "module",
5
5
  "license": "CC0-1.0",
6
6
  "publishConfig": {
@@ -10,7 +10,8 @@
10
10
  "dist"
11
11
  ],
12
12
  "engines": {
13
- "node": "^22.0.0"
13
+ "node": "^22",
14
+ "pnpm": "^10"
14
15
  },
15
16
  "main": "./dist/bundle.js",
16
17
  "types": "./dist/main.d.ts",
@@ -18,11 +19,6 @@
18
19
  "types": "./dist/main.d.ts",
19
20
  "import": "./dist/bundle.js"
20
21
  },
21
- "scripts": {
22
- "dev": "vite",
23
- "build": "tsc && vite build",
24
- "test": "vitest run"
25
- },
26
22
  "devDependencies": {
27
23
  "@types/node": "^24.3.1",
28
24
  "npm-check-updates": "^18.1.1",
@@ -42,5 +38,12 @@
42
38
  },
43
39
  "volta": {
44
40
  "node": "22.19.0"
41
+ },
42
+ "scripts": {
43
+ "dev": "vite",
44
+ "build": "tsc && vite build",
45
+ "test": "vitest run",
46
+ "preinstall": "npx only-allow pnpm",
47
+ "typecheck": "tsc --noEmit"
45
48
  }
46
- }
49
+ }