@tktb-tess/my-zod-schema 0.3.1 → 0.4.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 +51 -47
- package/dist/otmjson.d.ts +38 -8
- package/package.json +2 -2
package/dist/bundle.js
CHANGED
|
@@ -2,27 +2,27 @@ import * as t from "zod";
|
|
|
2
2
|
const r = t.object({
|
|
3
3
|
id: t.int().nonnegative(),
|
|
4
4
|
form: t.string()
|
|
5
|
-
}),
|
|
5
|
+
}), g = t.object({
|
|
6
6
|
title: t.string(),
|
|
7
7
|
forms: t.string().array(),
|
|
8
8
|
rawForms: t.string().optional()
|
|
9
|
-
}),
|
|
9
|
+
}), p = t.object({
|
|
10
10
|
title: t.string(),
|
|
11
11
|
text: t.string()
|
|
12
|
-
}),
|
|
12
|
+
}), d = t.object({
|
|
13
13
|
title: t.string(),
|
|
14
14
|
form: t.string()
|
|
15
|
-
}),
|
|
15
|
+
}), b = t.object({
|
|
16
16
|
title: t.string(),
|
|
17
17
|
entry: r
|
|
18
|
-
}),
|
|
18
|
+
}), y = {
|
|
19
19
|
entry: r,
|
|
20
|
-
translations:
|
|
20
|
+
translations: g.array(),
|
|
21
21
|
tags: t.string().array(),
|
|
22
|
-
contents:
|
|
23
|
-
variations:
|
|
24
|
-
relations:
|
|
25
|
-
},
|
|
22
|
+
contents: p.array(),
|
|
23
|
+
variations: d.array(),
|
|
24
|
+
relations: b.array()
|
|
25
|
+
}, S = t.object(y), o = t.looseObject(y), h = t.object({
|
|
26
26
|
id: t.int().nonnegative(),
|
|
27
27
|
sentence: t.string(),
|
|
28
28
|
translation: t.string(),
|
|
@@ -43,33 +43,37 @@ const r = t.object({
|
|
|
43
43
|
enableMarkdown: t.boolean()
|
|
44
44
|
}), u = t.object({
|
|
45
45
|
version: t.literal(1).optional(),
|
|
46
|
-
words: y.array()
|
|
47
|
-
}), o = t.looseObject({
|
|
48
|
-
version: t.literal(2),
|
|
49
46
|
words: S.array()
|
|
50
|
-
}),
|
|
47
|
+
}), i = t.object({
|
|
48
|
+
version: t.literal(2),
|
|
49
|
+
words: o.array()
|
|
50
|
+
}), N = t.looseObject({
|
|
51
|
+
version: t.literal(2),
|
|
52
|
+
words: o.array()
|
|
53
|
+
}), $ = t.discriminatedUnion("version", [
|
|
51
54
|
u,
|
|
52
|
-
|
|
53
|
-
]),
|
|
55
|
+
i
|
|
56
|
+
]), A = i.extend({
|
|
54
57
|
examples: h.array(),
|
|
55
58
|
zpdicOnline: j,
|
|
56
59
|
snoj: t.string().optional(),
|
|
57
60
|
zatlin: t.string().optional()
|
|
58
61
|
}), q = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
59
62
|
__proto__: null,
|
|
60
|
-
contentSchema:
|
|
63
|
+
contentSchema: p,
|
|
61
64
|
entrySchema: r,
|
|
62
|
-
|
|
63
|
-
relationSchema:
|
|
64
|
-
translationSchema:
|
|
65
|
+
looseV2Schema: N,
|
|
66
|
+
relationSchema: b,
|
|
67
|
+
translationSchema: g,
|
|
65
68
|
v1Schema: u,
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
69
|
+
v1orV2Schema: $,
|
|
70
|
+
v2Schema: i,
|
|
71
|
+
variationSchema: d,
|
|
72
|
+
wordV1Schema: S,
|
|
73
|
+
wordV2Schema: o,
|
|
70
74
|
zpdicConfigSchema: j,
|
|
71
75
|
zpdicExampleSchema: h,
|
|
72
|
-
zpdicOtmSchema:
|
|
76
|
+
zpdicOtmSchema: A
|
|
73
77
|
}, Symbol.toStringTag, { value: "Module" })), v = t.object({
|
|
74
78
|
titles: t.string().array(),
|
|
75
79
|
names: t.string().array(),
|
|
@@ -94,7 +98,7 @@ const r = t.object({
|
|
|
94
98
|
titles: t.string().array(),
|
|
95
99
|
number: t.int().nonnegative(),
|
|
96
100
|
name: t.string()
|
|
97
|
-
}),
|
|
101
|
+
}), s = t.string(), z = t.object({
|
|
98
102
|
sentence: t.string(),
|
|
99
103
|
supplement: t.string(),
|
|
100
104
|
translation: t.string(),
|
|
@@ -103,7 +107,7 @@ const r = t.object({
|
|
|
103
107
|
number: t.number()
|
|
104
108
|
}).array(),
|
|
105
109
|
offer: t.object({
|
|
106
|
-
catalog:
|
|
110
|
+
catalog: s,
|
|
107
111
|
number: t.number()
|
|
108
112
|
}).nullable()
|
|
109
113
|
}), a = z.extend({
|
|
@@ -118,57 +122,57 @@ const r = t.object({
|
|
|
118
122
|
informations: f.array(),
|
|
119
123
|
variations: O.array(),
|
|
120
124
|
relations: w.array()
|
|
121
|
-
}),
|
|
125
|
+
}), c = _.extend({
|
|
122
126
|
id: e,
|
|
123
127
|
number: t.int().nonnegative()
|
|
124
|
-
}),
|
|
128
|
+
}), l = c.extend({
|
|
125
129
|
examples: a.array()
|
|
126
|
-
}), A = t.object({
|
|
127
|
-
word: s
|
|
128
130
|
}), C = t.object({
|
|
129
131
|
word: c
|
|
130
132
|
}), M = t.object({
|
|
131
|
-
|
|
132
|
-
total: t.int().nonnegative()
|
|
133
|
+
word: l
|
|
133
134
|
}), D = t.object({
|
|
134
|
-
|
|
135
|
+
words: l.array(),
|
|
136
|
+
total: t.int().nonnegative()
|
|
135
137
|
}), U = t.object({
|
|
138
|
+
example: a
|
|
139
|
+
}), V = t.object({
|
|
136
140
|
examples: a.array(),
|
|
137
141
|
total: t.int().nonnegative()
|
|
138
|
-
}),
|
|
142
|
+
}), m = t.object({
|
|
139
143
|
id: e,
|
|
140
|
-
catalog:
|
|
144
|
+
catalog: s,
|
|
141
145
|
number: t.int().nonnegative(),
|
|
142
146
|
translation: t.string(),
|
|
143
147
|
supplement: t.string(),
|
|
144
148
|
author: t.string()
|
|
145
149
|
}), L = t.object({
|
|
146
|
-
exampleOffer:
|
|
150
|
+
exampleOffer: m
|
|
147
151
|
}), J = t.object({
|
|
148
|
-
exampleOffers:
|
|
152
|
+
exampleOffers: m.array(),
|
|
149
153
|
total: t.int().nonnegative()
|
|
150
154
|
}), F = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
151
155
|
__proto__: null,
|
|
152
|
-
catalogSchema:
|
|
156
|
+
catalogSchema: s,
|
|
153
157
|
editableExampleSchema: z,
|
|
154
158
|
editableWordSchema: _,
|
|
155
159
|
equivalentSchema: v,
|
|
156
160
|
exOfferResponseSchema: L,
|
|
157
|
-
exResponseSchema:
|
|
158
|
-
exampleOfferSchema:
|
|
161
|
+
exResponseSchema: U,
|
|
162
|
+
exampleOfferSchema: m,
|
|
159
163
|
exampleSchema: a,
|
|
160
164
|
informationSchema: f,
|
|
161
165
|
mExOfferResponseSchema: J,
|
|
162
|
-
mExResponseSchema:
|
|
163
|
-
mwweResponseSchema:
|
|
166
|
+
mExResponseSchema: V,
|
|
167
|
+
mwweResponseSchema: D,
|
|
164
168
|
objectIDSchema: e,
|
|
165
169
|
phraseSchema: x,
|
|
166
170
|
relationSchema: w,
|
|
167
171
|
variationSchema: O,
|
|
168
|
-
wordResponseSchema:
|
|
169
|
-
wordSchema:
|
|
170
|
-
wordWithExamplesSchema:
|
|
171
|
-
wweResponseSchema:
|
|
172
|
+
wordResponseSchema: C,
|
|
173
|
+
wordSchema: c,
|
|
174
|
+
wordWithExamplesSchema: l,
|
|
175
|
+
wweResponseSchema: M
|
|
172
176
|
}, Symbol.toStringTag, { value: "Module" })), P = t.object({
|
|
173
177
|
lastUpdate: t.iso.datetime(),
|
|
174
178
|
numberOf: t.int().nonnegative()
|
package/dist/otmjson.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ export declare const relationSchema: z.ZodObject<{
|
|
|
28
28
|
}, z.core.$strip>;
|
|
29
29
|
}, z.core.$strip>;
|
|
30
30
|
export type Relation = z.infer<typeof relationSchema>;
|
|
31
|
-
export declare const
|
|
31
|
+
export declare const wordV1Schema: z.ZodObject<{
|
|
32
32
|
entry: z.ZodObject<{
|
|
33
33
|
id: z.ZodInt;
|
|
34
34
|
form: z.ZodString;
|
|
@@ -55,7 +55,7 @@ export declare const wordv1Schema: z.ZodObject<{
|
|
|
55
55
|
}, z.core.$strip>;
|
|
56
56
|
}, z.core.$strip>>;
|
|
57
57
|
}, z.core.$strip>;
|
|
58
|
-
export declare const
|
|
58
|
+
export declare const wordV2Schema: z.ZodObject<{
|
|
59
59
|
entry: z.ZodObject<{
|
|
60
60
|
id: z.ZodInt;
|
|
61
61
|
form: z.ZodString;
|
|
@@ -82,8 +82,8 @@ export declare const wordv2Schema: z.ZodObject<{
|
|
|
82
82
|
}, z.core.$strip>;
|
|
83
83
|
}, z.core.$strip>>;
|
|
84
84
|
}, z.core.$loose>;
|
|
85
|
-
export type Wordv1 = z.infer<typeof
|
|
86
|
-
export type Wordv2 = z.infer<typeof
|
|
85
|
+
export type Wordv1 = z.infer<typeof wordV1Schema>;
|
|
86
|
+
export type Wordv2 = z.infer<typeof wordV2Schema>;
|
|
87
87
|
export declare const zpdicExampleSchema: z.ZodObject<{
|
|
88
88
|
id: z.ZodInt;
|
|
89
89
|
sentence: z.ZodString;
|
|
@@ -166,8 +166,38 @@ export declare const v2Schema: z.ZodObject<{
|
|
|
166
166
|
}, z.core.$strip>;
|
|
167
167
|
}, z.core.$strip>>;
|
|
168
168
|
}, z.core.$loose>>;
|
|
169
|
+
}, z.core.$strip>;
|
|
170
|
+
export declare const looseV2Schema: z.ZodObject<{
|
|
171
|
+
version: z.ZodLiteral<2>;
|
|
172
|
+
words: z.ZodArray<z.ZodObject<{
|
|
173
|
+
entry: z.ZodObject<{
|
|
174
|
+
id: z.ZodInt;
|
|
175
|
+
form: z.ZodString;
|
|
176
|
+
}, z.core.$strip>;
|
|
177
|
+
translations: z.ZodArray<z.ZodObject<{
|
|
178
|
+
title: z.ZodString;
|
|
179
|
+
forms: z.ZodArray<z.ZodString>;
|
|
180
|
+
rawForms: z.ZodOptional<z.ZodString>;
|
|
181
|
+
}, z.core.$strip>>;
|
|
182
|
+
tags: z.ZodArray<z.ZodString>;
|
|
183
|
+
contents: z.ZodArray<z.ZodObject<{
|
|
184
|
+
title: z.ZodString;
|
|
185
|
+
text: z.ZodString;
|
|
186
|
+
}, z.core.$strip>>;
|
|
187
|
+
variations: z.ZodArray<z.ZodObject<{
|
|
188
|
+
title: z.ZodString;
|
|
189
|
+
form: z.ZodString;
|
|
190
|
+
}, z.core.$strip>>;
|
|
191
|
+
relations: z.ZodArray<z.ZodObject<{
|
|
192
|
+
title: z.ZodString;
|
|
193
|
+
entry: z.ZodObject<{
|
|
194
|
+
id: z.ZodInt;
|
|
195
|
+
form: z.ZodString;
|
|
196
|
+
}, z.core.$strip>;
|
|
197
|
+
}, z.core.$strip>>;
|
|
198
|
+
}, z.core.$loose>>;
|
|
169
199
|
}, z.core.$loose>;
|
|
170
|
-
export declare const
|
|
200
|
+
export declare const v1orV2Schema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
171
201
|
version: z.ZodOptional<z.ZodLiteral<1>>;
|
|
172
202
|
words: z.ZodArray<z.ZodObject<{
|
|
173
203
|
entry: z.ZodObject<{
|
|
@@ -225,10 +255,10 @@ export declare const otmjsonSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
225
255
|
}, z.core.$strip>;
|
|
226
256
|
}, z.core.$strip>>;
|
|
227
257
|
}, z.core.$loose>>;
|
|
228
|
-
}, z.core.$
|
|
258
|
+
}, z.core.$strip>], "version">;
|
|
229
259
|
export type Ver1 = z.infer<typeof v1Schema>;
|
|
230
260
|
export type Ver2 = z.infer<typeof v2Schema>;
|
|
231
|
-
export type
|
|
261
|
+
export type LooseVer2 = z.infer<typeof looseV2Schema>;
|
|
232
262
|
export declare const zpdicOtmSchema: z.ZodObject<{
|
|
233
263
|
version: z.ZodLiteral<2>;
|
|
234
264
|
words: z.ZodArray<z.ZodObject<{
|
|
@@ -281,5 +311,5 @@ export declare const zpdicOtmSchema: z.ZodObject<{
|
|
|
281
311
|
}, z.core.$strip>;
|
|
282
312
|
snoj: z.ZodOptional<z.ZodString>;
|
|
283
313
|
zatlin: z.ZodOptional<z.ZodString>;
|
|
284
|
-
}, z.core.$
|
|
314
|
+
}, z.core.$strip>;
|
|
285
315
|
export type ZpDICOTM = z.infer<typeof zpdicOtmSchema>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tktb-tess/my-zod-schema",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "CC0-1.0",
|
|
6
6
|
"publishConfig": {
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"zod": "^3.0.0 || ^4.0.0"
|
|
37
37
|
},
|
|
38
38
|
"volta": {
|
|
39
|
-
"node": "22.
|
|
39
|
+
"node": "22.21.1"
|
|
40
40
|
},
|
|
41
41
|
"repository": {
|
|
42
42
|
"type": "git",
|