@nullix/zod-mongoose-studio 2.0.0 → 2.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/.output/nitro.json +1 -1
- package/.output/public/_nuxt/{BkE1sm_1.js → BYb-oWZd.js} +1 -1
- package/.output/public/_nuxt/{CCh0PVV0.js → BslsNWeO.js} +1 -1
- package/.output/public/_nuxt/{r6LdR7DN.js → ByzCJ9qg.js} +1 -1
- package/.output/public/_nuxt/{DJe7Wxdv.js → CEydsZ8-.js} +1 -1
- package/.output/public/_nuxt/{koEZfutw.js → CLz6MNQ2.js} +3 -3
- package/.output/public/_nuxt/{BC5hGokz.js → CVTJORg5.js} +1 -1
- package/.output/public/_nuxt/{CADbZwE5.js → CYpPdUat.js} +1 -1
- package/.output/public/_nuxt/{DV2n9B6m.js → CdDk3SWJ.js} +1 -1
- package/.output/public/_nuxt/{DVD-jGiv.js → CtvobD-H.js} +1 -1
- package/.output/public/_nuxt/{5KLjKHc1.js → DKUkGVFq.js} +1 -1
- package/.output/public/_nuxt/{BJwN20Xm.js → DNMZmLbK.js} +1 -1
- package/.output/public/_nuxt/{B2UrsJHg.js → Dfsc_W0R.js} +1 -1
- package/.output/public/_nuxt/{rEfOp38p.js → DvCFhKNi.js} +1 -1
- package/.output/public/_nuxt/EQtuxex4.js +33 -0
- package/.output/public/_nuxt/_u12_qo6.js +61 -0
- package/.output/public/_nuxt/{CB0WRoVi.js → b184ulLB.js} +1 -1
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/e94f7b27-aec2-4561-afff-7f7a9eb9f6e9.json +1 -0
- package/.output/public/_nuxt/{0J_bLG6U.js → c0F15Q-s.js} +1 -1
- package/.output/public/_nuxt/{Cr0GW7rA.js → cVykzrJ8.js} +1 -1
- package/.output/public/_nuxt/entry.J_CbC0oY.css +1 -0
- package/.output/public/_nuxt/{BMgDPqps.js → qtXB1NaS.js} +1 -1
- package/.output/public/_nuxt/{B_sGF2qN.js → s1ajeyOL.js} +1 -1
- package/.output/public/_nuxt/{DRBrUaE5.js → yvar5_gl.js} +1 -1
- package/.output/server/chunks/build/client.precomputed.mjs +1 -1
- package/.output/server/chunks/build/index-B4T6zHp0.mjs +1904 -0
- package/.output/server/chunks/build/index-B4T6zHp0.mjs.map +1 -0
- package/.output/server/chunks/build/server.mjs +223 -11
- package/.output/server/chunks/build/styles.mjs +3 -3
- package/.output/server/chunks/nitro/nitro.mjs +651 -336
- package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
- package/.output/server/chunks/routes/api/parse.post.mjs +127 -24
- package/.output/server/chunks/routes/api/parse.post.mjs.map +1 -1
- package/.output/server/index.mjs +1 -1
- package/.output/server/package.json +1 -1
- package/app/components/ZodMongooseStudio.vue +135 -46
- package/package.json +2 -2
- package/server/api/parse.post.ts +6 -0
- package/.output/public/_nuxt/BeaJ7I-K.js +0 -33
- package/.output/public/_nuxt/Dk9qGA5X.js +0 -59
- package/.output/public/_nuxt/builds/meta/dc761332-547d-4953-b51d-b2d453009b48.json +0 -1
- package/.output/public/_nuxt/entry.V-_Q9qpd.css +0 -1
- package/.output/server/chunks/build/index-Dnrh1ePF.mjs +0 -528
- package/.output/server/chunks/build/index-Dnrh1ePF.mjs.map +0 -1
|
@@ -1,528 +0,0 @@
|
|
|
1
|
-
import { defineComponent, ref, watch, mergeProps, withCtx, createTextVNode, useSlots, computed, unref, renderSlot, openBlock, createBlock, createCommentVNode, toDisplayString, useSSRContext } from 'vue';
|
|
2
|
-
import { ssrRenderComponent, ssrRenderAttrs, ssrRenderSlot, ssrRenderClass, ssrInterpolate } from 'vue/server-renderer';
|
|
3
|
-
import { _ as _export_sfc, h as _sfc_main$8, i as __nuxt_component_2$1, j as useRuntimeConfig, b as useAppConfig, c as useComponentUI, d as useFieldGroup, e as useComponentIcons, t as tv, P as Primitive, f as _sfc_main$d, g as _sfc_main$b } from './server.mjs';
|
|
4
|
-
import '../nitro/nitro.mjs';
|
|
5
|
-
import 'node:http';
|
|
6
|
-
import 'node:https';
|
|
7
|
-
import 'node:events';
|
|
8
|
-
import 'node:buffer';
|
|
9
|
-
import 'node:fs';
|
|
10
|
-
import 'node:path';
|
|
11
|
-
import 'node:crypto';
|
|
12
|
-
import 'node:url';
|
|
13
|
-
import '@iconify/utils';
|
|
14
|
-
import 'consola';
|
|
15
|
-
import 'tailwindcss/colors';
|
|
16
|
-
import 'perfect-debounce';
|
|
17
|
-
import '../routes/renderer.mjs';
|
|
18
|
-
import 'vue-bundle-renderer/runtime';
|
|
19
|
-
import 'unhead/server';
|
|
20
|
-
import 'devalue';
|
|
21
|
-
import 'unhead/utils';
|
|
22
|
-
|
|
23
|
-
const theme = {
|
|
24
|
-
"slots": {
|
|
25
|
-
"base": "font-medium inline-flex items-center",
|
|
26
|
-
"label": "truncate",
|
|
27
|
-
"leadingIcon": "shrink-0",
|
|
28
|
-
"leadingAvatar": "shrink-0",
|
|
29
|
-
"leadingAvatarSize": "",
|
|
30
|
-
"trailingIcon": "shrink-0"
|
|
31
|
-
},
|
|
32
|
-
"variants": {
|
|
33
|
-
"fieldGroup": {
|
|
34
|
-
"horizontal": "not-only:first:rounded-e-none not-only:last:rounded-s-none not-last:not-first:rounded-none focus-visible:z-[1]",
|
|
35
|
-
"vertical": "not-only:first:rounded-b-none not-only:last:rounded-t-none not-last:not-first:rounded-none focus-visible:z-[1]"
|
|
36
|
-
},
|
|
37
|
-
"color": {
|
|
38
|
-
"primary": "",
|
|
39
|
-
"secondary": "",
|
|
40
|
-
"success": "",
|
|
41
|
-
"info": "",
|
|
42
|
-
"warning": "",
|
|
43
|
-
"error": "",
|
|
44
|
-
"neutral": ""
|
|
45
|
-
},
|
|
46
|
-
"variant": {
|
|
47
|
-
"solid": "",
|
|
48
|
-
"outline": "",
|
|
49
|
-
"soft": "",
|
|
50
|
-
"subtle": ""
|
|
51
|
-
},
|
|
52
|
-
"size": {
|
|
53
|
-
"xs": {
|
|
54
|
-
"base": "text-[8px]/3 px-1 py-0.5 gap-1 rounded-sm",
|
|
55
|
-
"leadingIcon": "size-3",
|
|
56
|
-
"leadingAvatarSize": "3xs",
|
|
57
|
-
"trailingIcon": "size-3"
|
|
58
|
-
},
|
|
59
|
-
"sm": {
|
|
60
|
-
"base": "text-[10px]/3 px-1.5 py-1 gap-1 rounded-sm",
|
|
61
|
-
"leadingIcon": "size-3",
|
|
62
|
-
"leadingAvatarSize": "3xs",
|
|
63
|
-
"trailingIcon": "size-3"
|
|
64
|
-
},
|
|
65
|
-
"md": {
|
|
66
|
-
"base": "text-xs px-2 py-1 gap-1 rounded-md",
|
|
67
|
-
"leadingIcon": "size-4",
|
|
68
|
-
"leadingAvatarSize": "3xs",
|
|
69
|
-
"trailingIcon": "size-4"
|
|
70
|
-
},
|
|
71
|
-
"lg": {
|
|
72
|
-
"base": "text-sm px-2 py-1 gap-1.5 rounded-md",
|
|
73
|
-
"leadingIcon": "size-5",
|
|
74
|
-
"leadingAvatarSize": "2xs",
|
|
75
|
-
"trailingIcon": "size-5"
|
|
76
|
-
},
|
|
77
|
-
"xl": {
|
|
78
|
-
"base": "text-base px-2.5 py-1 gap-1.5 rounded-md",
|
|
79
|
-
"leadingIcon": "size-6",
|
|
80
|
-
"leadingAvatarSize": "2xs",
|
|
81
|
-
"trailingIcon": "size-6"
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
"square": {
|
|
85
|
-
"true": ""
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
"compoundVariants": [
|
|
89
|
-
{
|
|
90
|
-
"color": "primary",
|
|
91
|
-
"variant": "solid",
|
|
92
|
-
"class": "bg-primary text-inverted"
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
"color": "secondary",
|
|
96
|
-
"variant": "solid",
|
|
97
|
-
"class": "bg-secondary text-inverted"
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
"color": "success",
|
|
101
|
-
"variant": "solid",
|
|
102
|
-
"class": "bg-success text-inverted"
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
"color": "info",
|
|
106
|
-
"variant": "solid",
|
|
107
|
-
"class": "bg-info text-inverted"
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
"color": "warning",
|
|
111
|
-
"variant": "solid",
|
|
112
|
-
"class": "bg-warning text-inverted"
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
"color": "error",
|
|
116
|
-
"variant": "solid",
|
|
117
|
-
"class": "bg-error text-inverted"
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
"color": "primary",
|
|
121
|
-
"variant": "outline",
|
|
122
|
-
"class": "text-primary ring ring-inset ring-primary/50"
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
"color": "secondary",
|
|
126
|
-
"variant": "outline",
|
|
127
|
-
"class": "text-secondary ring ring-inset ring-secondary/50"
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
"color": "success",
|
|
131
|
-
"variant": "outline",
|
|
132
|
-
"class": "text-success ring ring-inset ring-success/50"
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
"color": "info",
|
|
136
|
-
"variant": "outline",
|
|
137
|
-
"class": "text-info ring ring-inset ring-info/50"
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
"color": "warning",
|
|
141
|
-
"variant": "outline",
|
|
142
|
-
"class": "text-warning ring ring-inset ring-warning/50"
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
"color": "error",
|
|
146
|
-
"variant": "outline",
|
|
147
|
-
"class": "text-error ring ring-inset ring-error/50"
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
"color": "primary",
|
|
151
|
-
"variant": "soft",
|
|
152
|
-
"class": "bg-primary/10 text-primary"
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
"color": "secondary",
|
|
156
|
-
"variant": "soft",
|
|
157
|
-
"class": "bg-secondary/10 text-secondary"
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
"color": "success",
|
|
161
|
-
"variant": "soft",
|
|
162
|
-
"class": "bg-success/10 text-success"
|
|
163
|
-
},
|
|
164
|
-
{
|
|
165
|
-
"color": "info",
|
|
166
|
-
"variant": "soft",
|
|
167
|
-
"class": "bg-info/10 text-info"
|
|
168
|
-
},
|
|
169
|
-
{
|
|
170
|
-
"color": "warning",
|
|
171
|
-
"variant": "soft",
|
|
172
|
-
"class": "bg-warning/10 text-warning"
|
|
173
|
-
},
|
|
174
|
-
{
|
|
175
|
-
"color": "error",
|
|
176
|
-
"variant": "soft",
|
|
177
|
-
"class": "bg-error/10 text-error"
|
|
178
|
-
},
|
|
179
|
-
{
|
|
180
|
-
"color": "primary",
|
|
181
|
-
"variant": "subtle",
|
|
182
|
-
"class": "bg-primary/10 text-primary ring ring-inset ring-primary/25"
|
|
183
|
-
},
|
|
184
|
-
{
|
|
185
|
-
"color": "secondary",
|
|
186
|
-
"variant": "subtle",
|
|
187
|
-
"class": "bg-secondary/10 text-secondary ring ring-inset ring-secondary/25"
|
|
188
|
-
},
|
|
189
|
-
{
|
|
190
|
-
"color": "success",
|
|
191
|
-
"variant": "subtle",
|
|
192
|
-
"class": "bg-success/10 text-success ring ring-inset ring-success/25"
|
|
193
|
-
},
|
|
194
|
-
{
|
|
195
|
-
"color": "info",
|
|
196
|
-
"variant": "subtle",
|
|
197
|
-
"class": "bg-info/10 text-info ring ring-inset ring-info/25"
|
|
198
|
-
},
|
|
199
|
-
{
|
|
200
|
-
"color": "warning",
|
|
201
|
-
"variant": "subtle",
|
|
202
|
-
"class": "bg-warning/10 text-warning ring ring-inset ring-warning/25"
|
|
203
|
-
},
|
|
204
|
-
{
|
|
205
|
-
"color": "error",
|
|
206
|
-
"variant": "subtle",
|
|
207
|
-
"class": "bg-error/10 text-error ring ring-inset ring-error/25"
|
|
208
|
-
},
|
|
209
|
-
{
|
|
210
|
-
"color": "neutral",
|
|
211
|
-
"variant": "solid",
|
|
212
|
-
"class": "text-inverted bg-inverted"
|
|
213
|
-
},
|
|
214
|
-
{
|
|
215
|
-
"color": "neutral",
|
|
216
|
-
"variant": "outline",
|
|
217
|
-
"class": "ring ring-inset ring-accented text-default bg-default"
|
|
218
|
-
},
|
|
219
|
-
{
|
|
220
|
-
"color": "neutral",
|
|
221
|
-
"variant": "soft",
|
|
222
|
-
"class": "text-default bg-elevated"
|
|
223
|
-
},
|
|
224
|
-
{
|
|
225
|
-
"color": "neutral",
|
|
226
|
-
"variant": "subtle",
|
|
227
|
-
"class": "ring ring-inset ring-accented text-default bg-elevated"
|
|
228
|
-
},
|
|
229
|
-
{
|
|
230
|
-
"size": "xs",
|
|
231
|
-
"square": true,
|
|
232
|
-
"class": "p-0.5"
|
|
233
|
-
},
|
|
234
|
-
{
|
|
235
|
-
"size": "sm",
|
|
236
|
-
"square": true,
|
|
237
|
-
"class": "p-1"
|
|
238
|
-
},
|
|
239
|
-
{
|
|
240
|
-
"size": "md",
|
|
241
|
-
"square": true,
|
|
242
|
-
"class": "p-1"
|
|
243
|
-
},
|
|
244
|
-
{
|
|
245
|
-
"size": "lg",
|
|
246
|
-
"square": true,
|
|
247
|
-
"class": "p-1"
|
|
248
|
-
},
|
|
249
|
-
{
|
|
250
|
-
"size": "xl",
|
|
251
|
-
"square": true,
|
|
252
|
-
"class": "p-1"
|
|
253
|
-
}
|
|
254
|
-
],
|
|
255
|
-
"defaultVariants": {
|
|
256
|
-
"color": "primary",
|
|
257
|
-
"variant": "solid",
|
|
258
|
-
"size": "md"
|
|
259
|
-
}
|
|
260
|
-
};
|
|
261
|
-
const _sfc_main$2 = {
|
|
262
|
-
__name: "UBadge",
|
|
263
|
-
__ssrInlineRender: true,
|
|
264
|
-
props: {
|
|
265
|
-
as: { type: null, required: false, default: "span" },
|
|
266
|
-
label: { type: [String, Number], required: false },
|
|
267
|
-
color: { type: null, required: false },
|
|
268
|
-
variant: { type: null, required: false },
|
|
269
|
-
size: { type: null, required: false },
|
|
270
|
-
square: { type: Boolean, required: false },
|
|
271
|
-
class: { type: null, required: false },
|
|
272
|
-
ui: { type: Object, required: false },
|
|
273
|
-
icon: { type: null, required: false },
|
|
274
|
-
avatar: { type: Object, required: false },
|
|
275
|
-
leading: { type: Boolean, required: false },
|
|
276
|
-
leadingIcon: { type: null, required: false },
|
|
277
|
-
trailing: { type: Boolean, required: false },
|
|
278
|
-
trailingIcon: { type: null, required: false }
|
|
279
|
-
},
|
|
280
|
-
setup(__props) {
|
|
281
|
-
const props = __props;
|
|
282
|
-
const slots = useSlots();
|
|
283
|
-
const appConfig = useAppConfig();
|
|
284
|
-
const uiProp = useComponentUI("badge", props);
|
|
285
|
-
const { orientation, size: fieldGroupSize } = useFieldGroup(props);
|
|
286
|
-
const { isLeading, isTrailing, leadingIconName, trailingIconName } = useComponentIcons(props);
|
|
287
|
-
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.badge || {} })({
|
|
288
|
-
color: props.color,
|
|
289
|
-
variant: props.variant,
|
|
290
|
-
size: fieldGroupSize.value || props.size,
|
|
291
|
-
square: props.square || !slots.default && !props.label,
|
|
292
|
-
fieldGroup: orientation.value
|
|
293
|
-
}));
|
|
294
|
-
return (_ctx, _push, _parent, _attrs) => {
|
|
295
|
-
_push(ssrRenderComponent(unref(Primitive), mergeProps({
|
|
296
|
-
as: __props.as,
|
|
297
|
-
"data-slot": "base",
|
|
298
|
-
class: ui.value.base({ class: [unref(uiProp)?.base, props.class] })
|
|
299
|
-
}, _attrs), {
|
|
300
|
-
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
301
|
-
if (_push2) {
|
|
302
|
-
ssrRenderSlot(_ctx.$slots, "leading", { ui: ui.value }, () => {
|
|
303
|
-
if (unref(isLeading) && unref(leadingIconName)) {
|
|
304
|
-
_push2(ssrRenderComponent(_sfc_main$d, {
|
|
305
|
-
name: unref(leadingIconName),
|
|
306
|
-
"data-slot": "leadingIcon",
|
|
307
|
-
class: ui.value.leadingIcon({ class: unref(uiProp)?.leadingIcon })
|
|
308
|
-
}, null, _parent2, _scopeId));
|
|
309
|
-
} else if (!!__props.avatar) {
|
|
310
|
-
_push2(ssrRenderComponent(_sfc_main$b, mergeProps({
|
|
311
|
-
size: unref(uiProp)?.leadingAvatarSize || ui.value.leadingAvatarSize()
|
|
312
|
-
}, __props.avatar, {
|
|
313
|
-
"data-slot": "leadingAvatar",
|
|
314
|
-
class: ui.value.leadingAvatar({ class: unref(uiProp)?.leadingAvatar })
|
|
315
|
-
}), null, _parent2, _scopeId));
|
|
316
|
-
} else {
|
|
317
|
-
_push2(`<!---->`);
|
|
318
|
-
}
|
|
319
|
-
}, _push2, _parent2, _scopeId);
|
|
320
|
-
ssrRenderSlot(_ctx.$slots, "default", { ui: ui.value }, () => {
|
|
321
|
-
if (__props.label !== void 0 && __props.label !== null) {
|
|
322
|
-
_push2(`<span data-slot="label" class="${ssrRenderClass(ui.value.label({ class: unref(uiProp)?.label }))}"${_scopeId}>${ssrInterpolate(__props.label)}</span>`);
|
|
323
|
-
} else {
|
|
324
|
-
_push2(`<!---->`);
|
|
325
|
-
}
|
|
326
|
-
}, _push2, _parent2, _scopeId);
|
|
327
|
-
ssrRenderSlot(_ctx.$slots, "trailing", { ui: ui.value }, () => {
|
|
328
|
-
if (unref(isTrailing) && unref(trailingIconName)) {
|
|
329
|
-
_push2(ssrRenderComponent(_sfc_main$d, {
|
|
330
|
-
name: unref(trailingIconName),
|
|
331
|
-
"data-slot": "trailingIcon",
|
|
332
|
-
class: ui.value.trailingIcon({ class: unref(uiProp)?.trailingIcon })
|
|
333
|
-
}, null, _parent2, _scopeId));
|
|
334
|
-
} else {
|
|
335
|
-
_push2(`<!---->`);
|
|
336
|
-
}
|
|
337
|
-
}, _push2, _parent2, _scopeId);
|
|
338
|
-
} else {
|
|
339
|
-
return [
|
|
340
|
-
renderSlot(_ctx.$slots, "leading", { ui: ui.value }, () => [
|
|
341
|
-
unref(isLeading) && unref(leadingIconName) ? (openBlock(), createBlock(_sfc_main$d, {
|
|
342
|
-
key: 0,
|
|
343
|
-
name: unref(leadingIconName),
|
|
344
|
-
"data-slot": "leadingIcon",
|
|
345
|
-
class: ui.value.leadingIcon({ class: unref(uiProp)?.leadingIcon })
|
|
346
|
-
}, null, 8, ["name", "class"])) : !!__props.avatar ? (openBlock(), createBlock(_sfc_main$b, mergeProps({
|
|
347
|
-
key: 1,
|
|
348
|
-
size: unref(uiProp)?.leadingAvatarSize || ui.value.leadingAvatarSize()
|
|
349
|
-
}, __props.avatar, {
|
|
350
|
-
"data-slot": "leadingAvatar",
|
|
351
|
-
class: ui.value.leadingAvatar({ class: unref(uiProp)?.leadingAvatar })
|
|
352
|
-
}), null, 16, ["size", "class"])) : createCommentVNode("", true)
|
|
353
|
-
]),
|
|
354
|
-
renderSlot(_ctx.$slots, "default", { ui: ui.value }, () => [
|
|
355
|
-
__props.label !== void 0 && __props.label !== null ? (openBlock(), createBlock("span", {
|
|
356
|
-
key: 0,
|
|
357
|
-
"data-slot": "label",
|
|
358
|
-
class: ui.value.label({ class: unref(uiProp)?.label })
|
|
359
|
-
}, toDisplayString(__props.label), 3)) : createCommentVNode("", true)
|
|
360
|
-
]),
|
|
361
|
-
renderSlot(_ctx.$slots, "trailing", { ui: ui.value }, () => [
|
|
362
|
-
unref(isTrailing) && unref(trailingIconName) ? (openBlock(), createBlock(_sfc_main$d, {
|
|
363
|
-
key: 0,
|
|
364
|
-
name: unref(trailingIconName),
|
|
365
|
-
"data-slot": "trailingIcon",
|
|
366
|
-
class: ui.value.trailingIcon({ class: unref(uiProp)?.trailingIcon })
|
|
367
|
-
}, null, 8, ["name", "class"])) : createCommentVNode("", true)
|
|
368
|
-
])
|
|
369
|
-
];
|
|
370
|
-
}
|
|
371
|
-
}),
|
|
372
|
-
_: 3
|
|
373
|
-
}, _parent));
|
|
374
|
-
};
|
|
375
|
-
}
|
|
376
|
-
};
|
|
377
|
-
const _sfc_setup$2 = _sfc_main$2.setup;
|
|
378
|
-
_sfc_main$2.setup = (props, ctx) => {
|
|
379
|
-
const ssrContext = useSSRContext();
|
|
380
|
-
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../../../node_modules/.pnpm/@nuxt+ui@4.6.0_@nuxt+content@3.12.0_better-sqlite3@12.8.0_magicast@0.5.2__@tiptap+exten_3f393c9004f614ad44f8f6b00c452ac6/node_modules/@nuxt/ui/dist/runtime/components/Badge.vue");
|
|
381
|
-
return _sfc_setup$2 ? _sfc_setup$2(props, ctx) : void 0;
|
|
382
|
-
};
|
|
383
|
-
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
384
|
-
__name: "ZodMongooseStudio",
|
|
385
|
-
__ssrInlineRender: true,
|
|
386
|
-
setup(__props) {
|
|
387
|
-
let debounceTimer;
|
|
388
|
-
const config = useRuntimeConfig();
|
|
389
|
-
const isLocalMode = ref(config.public.isLocalMode);
|
|
390
|
-
const isDocsMode = ref(config.public.isDocsMode);
|
|
391
|
-
const sourceCode = ref(`import { z } from 'zod/v4';
|
|
392
|
-
import { extractMongooseDef, toMongooseSchema } from '@nullix/zod-mongoose';
|
|
393
|
-
|
|
394
|
-
const UserSchema = z.object({
|
|
395
|
-
name: z.string(),
|
|
396
|
-
age: z.number().optional()
|
|
397
|
-
});
|
|
398
|
-
|
|
399
|
-
// Export your schema so the Studio can transform it
|
|
400
|
-
export default UserSchema;`);
|
|
401
|
-
const outputDef = ref("// Definition output...");
|
|
402
|
-
const outputSchema = ref("// Mongoose Schema output...");
|
|
403
|
-
const isCompiling = ref(false);
|
|
404
|
-
const handleCompile = async () => {
|
|
405
|
-
isCompiling.value = true;
|
|
406
|
-
try {
|
|
407
|
-
const response = await $fetch("/api/parse", {
|
|
408
|
-
method: "POST",
|
|
409
|
-
body: { sourceCode: sourceCode.value }
|
|
410
|
-
});
|
|
411
|
-
outputDef.value = `// Result of extractMongooseDef()
|
|
412
|
-
const definition = ${response.definition};`;
|
|
413
|
-
outputSchema.value = `// Result of toMongooseSchema().obj
|
|
414
|
-
const schemaObj = ${response.schemaObj};`;
|
|
415
|
-
} catch (error) {
|
|
416
|
-
const errText = `// Error
|
|
417
|
-
${error.data?.message || error.message}`;
|
|
418
|
-
outputDef.value = errText;
|
|
419
|
-
outputSchema.value = errText;
|
|
420
|
-
} finally {
|
|
421
|
-
isCompiling.value = false;
|
|
422
|
-
}
|
|
423
|
-
};
|
|
424
|
-
watch(
|
|
425
|
-
sourceCode,
|
|
426
|
-
() => {
|
|
427
|
-
if (isDocsMode.value) return;
|
|
428
|
-
clearTimeout(debounceTimer);
|
|
429
|
-
debounceTimer = setTimeout(handleCompile, 600);
|
|
430
|
-
}
|
|
431
|
-
);
|
|
432
|
-
if (isDocsMode.value) {
|
|
433
|
-
handleCompile();
|
|
434
|
-
}
|
|
435
|
-
return (_ctx, _push, _parent, _attrs) => {
|
|
436
|
-
const _component_UBadge = _sfc_main$2;
|
|
437
|
-
const _component_UButton = _sfc_main$8;
|
|
438
|
-
const _component_ClientOnly = __nuxt_component_2$1;
|
|
439
|
-
_push(`<div${ssrRenderAttrs(mergeProps({ class: "h-screen flex flex-col bg-gray-50 dark:bg-gray-950" }, _attrs))}><header class="bg-white dark:bg-gray-900 border-b border-gray-200 dark:border-gray-800 py-3 px-4 flex justify-between items-center shrink-0"><div class="flex items-center gap-4"><h1 class="text-xl font-bold text-primary"> @nullix/zod-mongoose Studio </h1>`);
|
|
440
|
-
if (isLocalMode.value) {
|
|
441
|
-
_push(ssrRenderComponent(_component_UBadge, {
|
|
442
|
-
color: "success",
|
|
443
|
-
variant: "soft"
|
|
444
|
-
}, {
|
|
445
|
-
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
446
|
-
if (_push2) {
|
|
447
|
-
_push2(`Local Mode`);
|
|
448
|
-
} else {
|
|
449
|
-
return [
|
|
450
|
-
createTextVNode("Local Mode")
|
|
451
|
-
];
|
|
452
|
-
}
|
|
453
|
-
}),
|
|
454
|
-
_: 1
|
|
455
|
-
}, _parent));
|
|
456
|
-
} else {
|
|
457
|
-
_push(ssrRenderComponent(_component_UBadge, {
|
|
458
|
-
color: "info",
|
|
459
|
-
variant: "soft"
|
|
460
|
-
}, {
|
|
461
|
-
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
462
|
-
if (_push2) {
|
|
463
|
-
_push2(`Docs Mode`);
|
|
464
|
-
} else {
|
|
465
|
-
return [
|
|
466
|
-
createTextVNode("Docs Mode")
|
|
467
|
-
];
|
|
468
|
-
}
|
|
469
|
-
}),
|
|
470
|
-
_: 1
|
|
471
|
-
}, _parent));
|
|
472
|
-
}
|
|
473
|
-
_push(`</div><div class="flex items-center gap-2">`);
|
|
474
|
-
if (isDocsMode.value) {
|
|
475
|
-
_push(ssrRenderComponent(_component_UButton, {
|
|
476
|
-
icon: "i-heroicons-play-solid",
|
|
477
|
-
color: "primary",
|
|
478
|
-
loading: isCompiling.value,
|
|
479
|
-
onClick: handleCompile
|
|
480
|
-
}, {
|
|
481
|
-
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
482
|
-
if (_push2) {
|
|
483
|
-
_push2(` Run `);
|
|
484
|
-
} else {
|
|
485
|
-
return [
|
|
486
|
-
createTextVNode(" Run ")
|
|
487
|
-
];
|
|
488
|
-
}
|
|
489
|
-
}),
|
|
490
|
-
_: 1
|
|
491
|
-
}, _parent));
|
|
492
|
-
} else if (isCompiling.value) {
|
|
493
|
-
_push(`<span class="text-sm text-gray-500">Transforming...</span>`);
|
|
494
|
-
} else {
|
|
495
|
-
_push(`<!---->`);
|
|
496
|
-
}
|
|
497
|
-
_push(`</div></header><div class="flex-1 grid grid-cols-2 gap-px bg-gray-200 dark:bg-gray-800 min-h-0"><div class="bg-white dark:bg-gray-950 h-full relative">`);
|
|
498
|
-
_push(ssrRenderComponent(_component_ClientOnly, null, {}, _parent));
|
|
499
|
-
_push(`</div><div class="flex flex-col h-full gap-px bg-gray-200 dark:bg-gray-800"><div class="flex-1 bg-white dark:bg-gray-950 relative flex flex-col min-h-0"><div class="px-3 py-1 bg-gray-100 dark:bg-gray-900 text-xs font-semibold text-gray-600 dark:text-gray-400 border-b border-gray-200 dark:border-gray-800 z-10"> extractMongooseDef() </div><div class="flex-1 relative">`);
|
|
500
|
-
_push(ssrRenderComponent(_component_ClientOnly, null, {}, _parent));
|
|
501
|
-
_push(`</div></div><div class="flex-1 bg-white dark:bg-gray-950 relative flex flex-col min-h-0"><div class="px-3 py-1 bg-gray-100 dark:bg-gray-900 text-xs font-semibold text-gray-600 dark:text-gray-400 border-b border-gray-200 dark:border-gray-800 z-10"> toMongooseSchema() </div><div class="flex-1 relative">`);
|
|
502
|
-
_push(ssrRenderComponent(_component_ClientOnly, null, {}, _parent));
|
|
503
|
-
_push(`</div></div></div></div></div>`);
|
|
504
|
-
};
|
|
505
|
-
}
|
|
506
|
-
});
|
|
507
|
-
const _sfc_setup$1 = _sfc_main$1.setup;
|
|
508
|
-
_sfc_main$1.setup = (props, ctx) => {
|
|
509
|
-
const ssrContext = useSSRContext();
|
|
510
|
-
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/ZodMongooseStudio.vue");
|
|
511
|
-
return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
|
|
512
|
-
};
|
|
513
|
-
const __nuxt_component_0 = Object.assign(_sfc_main$1, { __name: "ZodMongooseStudio" });
|
|
514
|
-
const _sfc_main = {};
|
|
515
|
-
function _sfc_ssrRender(_ctx, _push, _parent, _attrs) {
|
|
516
|
-
const _component_ZodMongooseStudio = __nuxt_component_0;
|
|
517
|
-
_push(ssrRenderComponent(_component_ZodMongooseStudio, _attrs, null, _parent));
|
|
518
|
-
}
|
|
519
|
-
const _sfc_setup = _sfc_main.setup;
|
|
520
|
-
_sfc_main.setup = (props, ctx) => {
|
|
521
|
-
const ssrContext = useSSRContext();
|
|
522
|
-
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/index.vue");
|
|
523
|
-
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
|
|
524
|
-
};
|
|
525
|
-
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["ssrRender", _sfc_ssrRender]]);
|
|
526
|
-
|
|
527
|
-
export { index as default };
|
|
528
|
-
//# sourceMappingURL=index-Dnrh1ePF.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-Dnrh1ePF.mjs","sources":["../../../../node_modules/.cache/nuxt/.nuxt/dist/server/_nuxt/index-Dnrh1ePF.js"],"names":["_sfc_main$3","_sfc_main$4","_sfc_main$5","__nuxt_component_2"],"mappings":"","x_google_ignoreList":[0]}
|