@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 +258 -177
- package/dist/comma-data.d.ts +49 -0
- package/dist/cotec-json.d.ts +102 -0
- package/dist/main.d.ts +2 -1
- package/dist/util.d.ts +1 -20
- package/dist/zpdic.d.ts +61 -22
- package/package.json +11 -8
package/dist/bundle.js
CHANGED
|
@@ -1,186 +1,267 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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:
|
|
57
|
-
catalog:
|
|
58
|
-
number:
|
|
34
|
+
offer: t.object({
|
|
35
|
+
catalog: t.string(),
|
|
36
|
+
number: t.int().nonnegative()
|
|
59
37
|
}).optional()
|
|
60
|
-
}),
|
|
61
|
-
explanation:
|
|
62
|
-
punctuations:
|
|
63
|
-
ignoredPattern:
|
|
64
|
-
pronunciationTitle:
|
|
65
|
-
enableMarkdown:
|
|
66
|
-
}),
|
|
67
|
-
version:
|
|
68
|
-
words:
|
|
69
|
-
}).brand(),
|
|
70
|
-
version:
|
|
71
|
-
words:
|
|
72
|
-
}).brand(),
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
]),
|
|
76
|
-
examples:
|
|
77
|
-
zpdicOnline:
|
|
78
|
-
snoj:
|
|
79
|
-
zatlin:
|
|
80
|
-
}),
|
|
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:
|
|
83
|
-
entrySchema:
|
|
84
|
-
otmjsonSchema:
|
|
85
|
-
relationSchema:
|
|
86
|
-
translationSchema:
|
|
87
|
-
v1Schema:
|
|
88
|
-
v2Schema:
|
|
89
|
-
variationSchema:
|
|
90
|
-
wordv1Schema:
|
|
91
|
-
wordv2Schema:
|
|
92
|
-
zpdicConfigSchema:
|
|
93
|
-
zpdicExampleSchema:
|
|
94
|
-
zpdicOtmSchema:
|
|
95
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
96
|
-
titles:
|
|
97
|
-
names:
|
|
98
|
-
nameString:
|
|
99
|
-
ignoredPattern:
|
|
100
|
-
hidden:
|
|
101
|
-
}),
|
|
102
|
-
title:
|
|
103
|
-
text:
|
|
104
|
-
hidden:
|
|
105
|
-
}),
|
|
106
|
-
titles:
|
|
107
|
-
form:
|
|
108
|
-
terms:
|
|
109
|
-
termString:
|
|
110
|
-
ignoredPattern:
|
|
111
|
-
}),
|
|
112
|
-
title:
|
|
113
|
-
name:
|
|
114
|
-
pronunciation:
|
|
115
|
-
}),
|
|
116
|
-
titles:
|
|
117
|
-
number:
|
|
118
|
-
name:
|
|
119
|
-
}),
|
|
120
|
-
sentence:
|
|
121
|
-
supplement:
|
|
122
|
-
translation:
|
|
123
|
-
tags:
|
|
124
|
-
words:
|
|
125
|
-
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:
|
|
128
|
-
catalog:
|
|
129
|
-
number:
|
|
105
|
+
offer: t.object({
|
|
106
|
+
catalog: S,
|
|
107
|
+
number: t.number()
|
|
130
108
|
}).nullable()
|
|
131
|
-
}),
|
|
132
|
-
id:
|
|
133
|
-
number:
|
|
134
|
-
}),
|
|
135
|
-
name:
|
|
136
|
-
pronunciation:
|
|
137
|
-
equivalents:
|
|
138
|
-
tags:
|
|
139
|
-
phrases:
|
|
140
|
-
informations:
|
|
141
|
-
variations:
|
|
142
|
-
relations:
|
|
143
|
-
}),
|
|
144
|
-
id:
|
|
145
|
-
number:
|
|
146
|
-
}),
|
|
147
|
-
examples:
|
|
148
|
-
}),
|
|
149
|
-
word:
|
|
150
|
-
}),
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
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
|
-
|
|
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
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
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
package/dist/util.d.ts
CHANGED
|
@@ -1,20 +1 @@
|
|
|
1
|
-
|
|
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
|
|
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
|
|
249
|
-
export declare const
|
|
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
|
|
304
|
-
export declare const
|
|
305
|
-
|
|
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
|
|
323
|
-
export declare const
|
|
324
|
-
|
|
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
|
|
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
|
|
351
|
-
|
|
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
|
|
362
|
-
export declare const
|
|
363
|
-
|
|
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
|
|
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.
|
|
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
|
|
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
|
+
}
|