@nullix/zod-mongoose-studio 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.output/nitro.json +15 -0
- package/.output/public/_nuxt/8SOpv6rk.js +1 -0
- package/.output/public/_nuxt/9HpZscsL.js +2 -0
- package/.output/public/_nuxt/B2KnRiWG.js +4 -0
- package/.output/public/_nuxt/B8OfTtLu.js +1 -0
- package/.output/public/_nuxt/BBUBE1dy.js +1 -0
- package/.output/public/_nuxt/BBc9UKZt.js +1 -0
- package/.output/public/_nuxt/BDtDVThU.js +1 -0
- package/.output/public/_nuxt/BEgZUVRK.js +1 -0
- package/.output/public/_nuxt/BFxVWTOG.js +1 -0
- package/.output/public/_nuxt/BG73LgW2.js +1 -0
- package/.output/public/_nuxt/BKILRCQU.js +1 -0
- package/.output/public/_nuxt/BOtBlQCF.js +1 -0
- package/.output/public/_nuxt/BPhDTwHR.js +1 -0
- package/.output/public/_nuxt/BTesnYfV.js +298 -0
- package/.output/public/_nuxt/BbWJElDN.js +1 -0
- package/.output/public/_nuxt/BcvAzS8a.js +3 -0
- package/.output/public/_nuxt/Bd8akH9Z.js +1 -0
- package/.output/public/_nuxt/Be1F0pOV.js +1 -0
- package/.output/public/_nuxt/BeJ5waoc.js +1 -0
- package/.output/public/_nuxt/Bf6VGUru.js +1 -0
- package/.output/public/_nuxt/BkW5O-1t.js +1 -0
- package/.output/public/_nuxt/BlNEE0v7.js +1 -0
- package/.output/public/_nuxt/Brw8urJB.js +2 -0
- package/.output/public/_nuxt/Bs9aos_-.js +1 -0
- package/.output/public/_nuxt/Bs9z6M-B.js +1 -0
- package/.output/public/_nuxt/Btyra-wh.js +1 -0
- package/.output/public/_nuxt/Bu5POkcn.js +1 -0
- package/.output/public/_nuxt/Bw9ernYp.js +1 -0
- package/.output/public/_nuxt/BwHxbl9M.js +1 -0
- package/.output/public/_nuxt/BxJiqAUM.js +1 -0
- package/.output/public/_nuxt/BzKRNQWT.js +1 -0
- package/.output/public/_nuxt/CBJaRo0y.js +3 -0
- package/.output/public/_nuxt/CFznDFnq.js +2 -0
- package/.output/public/_nuxt/CHwy0fLd.js +1 -0
- package/.output/public/_nuxt/CJmd_6j2.js +1 -0
- package/.output/public/_nuxt/CMQZ64NL.js +1 -0
- package/.output/public/_nuxt/COWaemsV.js +1 -0
- package/.output/public/_nuxt/CXBNlu9o.js +1 -0
- package/.output/public/_nuxt/C_tMU-Nz.js +1 -0
- package/.output/public/_nuxt/CiqrrVzr.js +1 -0
- package/.output/public/_nuxt/ClhHkBeG.js +1 -0
- package/.output/public/_nuxt/CnS9iZB_.js +1 -0
- package/.output/public/_nuxt/CnmFD0ga.js +1 -0
- package/.output/public/_nuxt/Co3qMtFm.js +1 -0
- package/.output/public/_nuxt/CocnycG-.js +1 -0
- package/.output/public/_nuxt/CpO_ztTX.js +1 -0
- package/.output/public/_nuxt/CqXO7rUv.js +1 -0
- package/.output/public/_nuxt/Csy3S7wG.js +1 -0
- package/.output/public/_nuxt/CtU7CIYd.js +11 -0
- package/.output/public/_nuxt/Cw6BJv9p.js +908 -0
- package/.output/public/_nuxt/Cyyb5UIc.js +1 -0
- package/.output/public/_nuxt/D-4FJmMZ.js +1 -0
- package/.output/public/_nuxt/D9hQfWCl.js +1 -0
- package/.output/public/_nuxt/DARyPmWN.js +1 -0
- package/.output/public/_nuxt/DA_xQXIa.js +1 -0
- package/.output/public/_nuxt/DIpCSwC3.js +1 -0
- package/.output/public/_nuxt/DLDM7-KI.js +1 -0
- package/.output/public/_nuxt/DNDY2TF8.js +1 -0
- package/.output/public/_nuxt/DSgGBnBI.js +1 -0
- package/.output/public/_nuxt/DSh2-awV.js +1 -0
- package/.output/public/_nuxt/DWLU9E4j.js +7 -0
- package/.output/public/_nuxt/Db0IVjzk.js +1 -0
- package/.output/public/_nuxt/Db0cS2oM.js +1 -0
- package/.output/public/_nuxt/Dcm9cKUX.js +1 -0
- package/.output/public/_nuxt/DdJfP1eB.js +3 -0
- package/.output/public/_nuxt/DiJ1NA_G.js +1 -0
- package/.output/public/_nuxt/Dj0IH4Bd.js +1 -0
- package/.output/public/_nuxt/Dm6ycUr_.js +1 -0
- package/.output/public/_nuxt/Dm9fPMHo.js +1 -0
- package/.output/public/_nuxt/DmeGPVcC.js +1 -0
- package/.output/public/_nuxt/Dnu-v4kV.js +1 -0
- package/.output/public/_nuxt/DtV1sZF8.js +1 -0
- package/.output/public/_nuxt/DtZ0uQbO.js +1 -0
- package/.output/public/_nuxt/DuqnmPmx.js +33 -0
- package/.output/public/_nuxt/JqRWe2rp.js +1 -0
- package/.output/public/_nuxt/Kd9XrMLS.js +1 -0
- package/.output/public/_nuxt/OrD6JF1K.js +1 -0
- package/.output/public/_nuxt/PahG7c26.js +1 -0
- package/.output/public/_nuxt/Ub6l9XKa.js +1 -0
- package/.output/public/_nuxt/XOt5hzHz.js +1 -0
- package/.output/public/_nuxt/Y6nb8tq_.js +1 -0
- package/.output/public/_nuxt/acbASCJo.js +1 -0
- package/.output/public/_nuxt/builds/latest.json +1 -0
- package/.output/public/_nuxt/builds/meta/5f8bfdb9-d523-4660-afb9-2a5faf918ee2.json +1 -0
- package/.output/public/_nuxt/cCwfBBRk.js +59 -0
- package/.output/public/_nuxt/cTPe9QuQ.js +1 -0
- package/.output/public/_nuxt/c_t8T7LW.js +1 -0
- package/.output/public/_nuxt/cl7-CwDS.js +1 -0
- package/.output/public/_nuxt/codicon.ngg6Pgfi.ttf +0 -0
- package/.output/public/_nuxt/css.worker-DBVD8oXr.js +93 -0
- package/.output/public/_nuxt/editor.CdBKkuhR.css +1 -0
- package/.output/public/_nuxt/editor.worker-CdQrwHl8.js +26 -0
- package/.output/public/_nuxt/entry.V-_Q9qpd.css +1 -0
- package/.output/public/_nuxt/error-404.ZEdaMr7r.css +1 -0
- package/.output/public/_nuxt/error-500.CPEQ7gwd.css +1 -0
- package/.output/public/_nuxt/html.worker-CwpTb9lJ.js +470 -0
- package/.output/public/_nuxt/j7ic8hl3.js +1 -0
- package/.output/public/_nuxt/json.worker-BoL8UZqY.js +58 -0
- package/.output/public/_nuxt/s7OhZKlX.js +1 -0
- package/.output/public/_nuxt/tScXyioY.js +1 -0
- package/.output/public/_nuxt/ts.worker-CTGvpNXs.js +67718 -0
- package/.output/public/_nuxt/vHIfCaH5.js +1 -0
- package/.output/public/_nuxt/zBfavPgS.js +1 -0
- package/.output/public/android-chrome-192x192.png +0 -0
- package/.output/public/android-chrome-512x512.png +0 -0
- package/.output/public/apple-touch-icon.png +0 -0
- package/.output/public/favicon-16x16.png +0 -0
- package/.output/public/favicon-32x32.png +0 -0
- package/.output/public/favicon.ico +0 -0
- package/.output/public/robots.txt +2 -0
- package/.output/public/site.webmanifest +1 -0
- package/.output/public/zodmongoose-b.jpg +0 -0
- package/.output/public/zodmongoose-b.png +0 -0
- package/.output/public/zodmongoose-b.svg +10 -0
- package/.output/public/zodmongoose.jpg +0 -0
- package/.output/public/zodmongoose.png +0 -0
- package/.output/public/zodmongoose.svg +12 -0
- package/.output/server/chunks/_/error-500.mjs +19 -0
- package/.output/server/chunks/_/error-500.mjs.map +1 -0
- package/.output/server/chunks/build/client.precomputed.mjs +4 -0
- package/.output/server/chunks/build/client.precomputed.mjs.map +1 -0
- package/.output/server/chunks/build/error-404-C01T0Fs3.mjs +93 -0
- package/.output/server/chunks/build/error-404-C01T0Fs3.mjs.map +1 -0
- package/.output/server/chunks/build/error-404-styles.C9SFt1Pa.mjs +8 -0
- package/.output/server/chunks/build/error-404-styles.C9SFt1Pa.mjs.map +1 -0
- package/.output/server/chunks/build/error-500-BxPzc_RO.mjs +76 -0
- package/.output/server/chunks/build/error-500-BxPzc_RO.mjs.map +1 -0
- package/.output/server/chunks/build/error-500-styles.BgBkJrKx.mjs +8 -0
- package/.output/server/chunks/build/error-500-styles.BgBkJrKx.mjs.map +1 -0
- package/.output/server/chunks/build/index-Cm3PgUzj.mjs +504 -0
- package/.output/server/chunks/build/index-Cm3PgUzj.mjs.map +1 -0
- package/.output/server/chunks/build/server.mjs +14569 -0
- package/.output/server/chunks/build/server.mjs.map +1 -0
- package/.output/server/chunks/build/styles.mjs +10 -0
- package/.output/server/chunks/build/styles.mjs.map +1 -0
- package/.output/server/chunks/nitro/nitro.mjs +6533 -0
- package/.output/server/chunks/nitro/nitro.mjs.map +1 -0
- package/.output/server/chunks/routes/api/parse.post.mjs +1293 -0
- package/.output/server/chunks/routes/api/parse.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/resolve.get.mjs +42 -0
- package/.output/server/chunks/routes/api/resolve.get.mjs.map +1 -0
- package/.output/server/chunks/routes/renderer.mjs +483 -0
- package/.output/server/chunks/routes/renderer.mjs.map +1 -0
- package/.output/server/chunks/virtual/_virtual_spa-template.mjs +4 -0
- package/.output/server/chunks/virtual/_virtual_spa-template.mjs.map +1 -0
- package/.output/server/index.mjs +12 -0
- package/.output/server/index.mjs.map +1 -0
- package/.output/server/node_modules/@babel/parser/lib/index.js +14582 -0
- package/.output/server/node_modules/@babel/parser/package.json +50 -0
- package/.output/server/node_modules/@esbuild/darwin-arm64/bin/esbuild +0 -0
- package/.output/server/node_modules/@esbuild/darwin-arm64/package.json +20 -0
- package/.output/server/node_modules/@iconify/utils/lib/colors/index.js +292 -0
- package/.output/server/node_modules/@iconify/utils/lib/colors/keywords.js +702 -0
- package/.output/server/node_modules/@iconify/utils/lib/css/common.js +76 -0
- package/.output/server/node_modules/@iconify/utils/lib/css/format.js +40 -0
- package/.output/server/node_modules/@iconify/utils/lib/css/icon.js +52 -0
- package/.output/server/node_modules/@iconify/utils/lib/css/icons.js +133 -0
- package/.output/server/node_modules/@iconify/utils/lib/customisations/bool.js +20 -0
- package/.output/server/node_modules/@iconify/utils/lib/customisations/defaults.js +15 -0
- package/.output/server/node_modules/@iconify/utils/lib/customisations/flip.js +18 -0
- package/.output/server/node_modules/@iconify/utils/lib/customisations/merge.js +18 -0
- package/.output/server/node_modules/@iconify/utils/lib/customisations/rotate.js +31 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/cleanup.js +80 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/convert.js +102 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/data.js +29 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/format.js +60 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/parse.js +50 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/base.js +204 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/create.js +35 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/numbers.js +134 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/similar.js +167 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/tree.js +81 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/replace/find.js +94 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/replace/replace.js +28 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/components.js +78 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/missing.js +68 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/name.js +47 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/parse.js +105 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/similar.js +38 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/tree.js +94 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/variations.js +64 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon/defaults.js +26 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon/merge.js +18 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon/name.js +58 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon/square.js +34 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon/transformations.js +13 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/convert-info.js +126 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/expand.js +21 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/get-icon.js +27 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/get-icons.js +38 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/minify.js +93 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/parse.js +48 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/tree.js +24 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/validate-basic.js +44 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/validate.js +125 -0
- package/.output/server/node_modules/@iconify/utils/lib/index.js +53 -0
- package/.output/server/node_modules/@iconify/utils/lib/loader/custom.js +32 -0
- package/.output/server/node_modules/@iconify/utils/lib/loader/loader.js +28 -0
- package/.output/server/node_modules/@iconify/utils/lib/loader/modern.js +42 -0
- package/.output/server/node_modules/@iconify/utils/lib/loader/utils.js +63 -0
- package/.output/server/node_modules/@iconify/utils/lib/misc/objects.js +27 -0
- package/.output/server/node_modules/@iconify/utils/lib/misc/strings.js +27 -0
- package/.output/server/node_modules/@iconify/utils/lib/misc/title.js +10 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/build.js +115 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/defs.js +32 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/encode-svg-for-css.js +15 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/html.js +10 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/id.js +42 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/inner-html.js +23 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/parse.js +69 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/pretty.js +55 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/size.js +28 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/trim.js +8 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/url.js +23 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/viewbox.js +9 -0
- package/.output/server/node_modules/@iconify/utils/package.json +118 -0
- package/.output/server/node_modules/@mongodb-js/saslprep/dist/code-points-data.js +5 -0
- package/.output/server/node_modules/@mongodb-js/saslprep/dist/index.js +65 -0
- package/.output/server/node_modules/@mongodb-js/saslprep/dist/memory-code-points.js +32 -0
- package/.output/server/node_modules/@mongodb-js/saslprep/dist/node.js +15 -0
- package/.output/server/node_modules/@mongodb-js/saslprep/package.json +87 -0
- package/.output/server/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js +6763 -0
- package/.output/server/node_modules/@vue/compiler-core/package.json +58 -0
- package/.output/server/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js +689 -0
- package/.output/server/node_modules/@vue/compiler-dom/package.json +57 -0
- package/.output/server/node_modules/@vue/compiler-ssr/dist/compiler-ssr.cjs.js +1413 -0
- package/.output/server/node_modules/@vue/compiler-ssr/package.json +34 -0
- package/.output/server/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js +1877 -0
- package/.output/server/node_modules/@vue/reactivity/package.json +55 -0
- package/.output/server/node_modules/@vue/runtime-core/dist/runtime-core.cjs.prod.js +6856 -0
- package/.output/server/node_modules/@vue/runtime-core/package.json +52 -0
- package/.output/server/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.prod.js +1796 -0
- package/.output/server/node_modules/@vue/runtime-dom/package.json +60 -0
- package/.output/server/node_modules/@vue/server-renderer/dist/server-renderer.cjs.prod.js +883 -0
- package/.output/server/node_modules/@vue/server-renderer/package.json +55 -0
- package/.output/server/node_modules/@vue/shared/dist/shared.cjs.prod.js +604 -0
- package/.output/server/node_modules/@vue/shared/package.json +47 -0
- package/.output/server/node_modules/bson/lib/bson.cjs +4636 -0
- package/.output/server/node_modules/bson/package.json +120 -0
- package/.output/server/node_modules/consola/dist/chunks/prompt.mjs +280 -0
- package/.output/server/node_modules/consola/dist/core.mjs +512 -0
- package/.output/server/node_modules/consola/dist/index.mjs +651 -0
- package/.output/server/node_modules/consola/dist/shared/consola.DRwqZj3T.mjs +72 -0
- package/.output/server/node_modules/consola/dist/shared/consola.DXBYu-KD.mjs +288 -0
- package/.output/server/node_modules/consola/package.json +136 -0
- package/.output/server/node_modules/debug/package.json +64 -0
- package/.output/server/node_modules/debug/src/browser.js +272 -0
- package/.output/server/node_modules/debug/src/common.js +292 -0
- package/.output/server/node_modules/debug/src/index.js +10 -0
- package/.output/server/node_modules/debug/src/node.js +263 -0
- package/.output/server/node_modules/devalue/index.js +4 -0
- package/.output/server/node_modules/devalue/package.json +37 -0
- package/.output/server/node_modules/devalue/src/base64.js +110 -0
- package/.output/server/node_modules/devalue/src/constants.js +7 -0
- package/.output/server/node_modules/devalue/src/parse.js +265 -0
- package/.output/server/node_modules/devalue/src/stringify.js +350 -0
- package/.output/server/node_modules/devalue/src/uneval.js +490 -0
- package/.output/server/node_modules/devalue/src/utils.js +148 -0
- package/.output/server/node_modules/entities/dist/commonjs/decode-codepoint.js +77 -0
- package/.output/server/node_modules/entities/dist/commonjs/decode.js +568 -0
- package/.output/server/node_modules/entities/dist/commonjs/generated/decode-data-html.js +7 -0
- package/.output/server/node_modules/entities/dist/commonjs/generated/decode-data-xml.js +7 -0
- package/.output/server/node_modules/entities/dist/commonjs/internal/bin-trie-flags.js +21 -0
- package/.output/server/node_modules/entities/dist/commonjs/internal/decode-shared.js +31 -0
- package/.output/server/node_modules/entities/dist/commonjs/package.json +3 -0
- package/.output/server/node_modules/entities/package.json +120 -0
- package/.output/server/node_modules/esbuild/lib/main.js +2532 -0
- package/.output/server/node_modules/esbuild/package.json +74 -0
- package/.output/server/node_modules/estree-walker/dist/umd/estree-walker.js +344 -0
- package/.output/server/node_modules/estree-walker/package.json +37 -0
- package/.output/server/node_modules/hookable/dist/index.mjs +266 -0
- package/.output/server/node_modules/hookable/package.json +53 -0
- package/.output/server/node_modules/ip-address/dist/address-error.js +12 -0
- package/.output/server/node_modules/ip-address/dist/common.js +46 -0
- package/.output/server/node_modules/ip-address/dist/ip-address.js +35 -0
- package/.output/server/node_modules/ip-address/dist/ipv4.js +360 -0
- package/.output/server/node_modules/ip-address/dist/ipv6.js +1003 -0
- package/.output/server/node_modules/ip-address/dist/v4/constants.js +8 -0
- package/.output/server/node_modules/ip-address/dist/v6/constants.js +76 -0
- package/.output/server/node_modules/ip-address/dist/v6/helpers.js +45 -0
- package/.output/server/node_modules/ip-address/dist/v6/regular-expressions.js +95 -0
- package/.output/server/node_modules/ip-address/package.json +78 -0
- package/.output/server/node_modules/kareem/index.js +668 -0
- package/.output/server/node_modules/kareem/package.json +28 -0
- package/.output/server/node_modules/memory-pager/index.js +160 -0
- package/.output/server/node_modules/memory-pager/package.json +24 -0
- package/.output/server/node_modules/mongodb/lib/admin.js +136 -0
- package/.output/server/node_modules/mongodb/lib/bson.js +84 -0
- package/.output/server/node_modules/mongodb/lib/bulk/common.js +837 -0
- package/.output/server/node_modules/mongodb/lib/bulk/ordered.js +67 -0
- package/.output/server/node_modules/mongodb/lib/bulk/unordered.js +92 -0
- package/.output/server/node_modules/mongodb/lib/change_stream.js +465 -0
- package/.output/server/node_modules/mongodb/lib/client-side-encryption/auto_encrypter.js +274 -0
- package/.output/server/node_modules/mongodb/lib/client-side-encryption/client_encryption.js +610 -0
- package/.output/server/node_modules/mongodb/lib/client-side-encryption/crypto_callbacks.js +81 -0
- package/.output/server/node_modules/mongodb/lib/client-side-encryption/errors.js +136 -0
- package/.output/server/node_modules/mongodb/lib/client-side-encryption/mongocryptd_manager.js +85 -0
- package/.output/server/node_modules/mongodb/lib/client-side-encryption/providers/aws.js +23 -0
- package/.output/server/node_modules/mongodb/lib/client-side-encryption/providers/azure.js +132 -0
- package/.output/server/node_modules/mongodb/lib/client-side-encryption/providers/gcp.js +16 -0
- package/.output/server/node_modules/mongodb/lib/client-side-encryption/providers/index.js +43 -0
- package/.output/server/node_modules/mongodb/lib/client-side-encryption/state_machine.js +426 -0
- package/.output/server/node_modules/mongodb/lib/cmap/auth/auth_provider.js +51 -0
- package/.output/server/node_modules/mongodb/lib/cmap/auth/aws_temporary_credentials.js +150 -0
- package/.output/server/node_modules/mongodb/lib/cmap/auth/gssapi.js +154 -0
- package/.output/server/node_modules/mongodb/lib/cmap/auth/mongo_credentials.js +183 -0
- package/.output/server/node_modules/mongodb/lib/cmap/auth/mongodb_aws.js +138 -0
- package/.output/server/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/automated_callback_workflow.js +84 -0
- package/.output/server/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/azure_machine_workflow.js +62 -0
- package/.output/server/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/callback_workflow.js +141 -0
- package/.output/server/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/command_builders.js +44 -0
- package/.output/server/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/gcp_machine_workflow.js +39 -0
- package/.output/server/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/human_callback_workflow.js +122 -0
- package/.output/server/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/k8s_machine_workflow.js +31 -0
- package/.output/server/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_cache.js +52 -0
- package/.output/server/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_machine_workflow.js +22 -0
- package/.output/server/node_modules/mongodb/lib/cmap/auth/mongodb_oidc.js +73 -0
- package/.output/server/node_modules/mongodb/lib/cmap/auth/plain.js +26 -0
- package/.output/server/node_modules/mongodb/lib/cmap/auth/providers.js +23 -0
- package/.output/server/node_modules/mongodb/lib/cmap/auth/scram.js +254 -0
- package/.output/server/node_modules/mongodb/lib/cmap/auth/x509.js +36 -0
- package/.output/server/node_modules/mongodb/lib/cmap/command_monitoring_events.js +223 -0
- package/.output/server/node_modules/mongodb/lib/cmap/commands.js +535 -0
- package/.output/server/node_modules/mongodb/lib/cmap/connect.js +366 -0
- package/.output/server/node_modules/mongodb/lib/cmap/connection.js +570 -0
- package/.output/server/node_modules/mongodb/lib/cmap/connection_pool.js +558 -0
- package/.output/server/node_modules/mongodb/lib/cmap/connection_pool_events.js +190 -0
- package/.output/server/node_modules/mongodb/lib/cmap/errors.js +108 -0
- package/.output/server/node_modules/mongodb/lib/cmap/handshake/client_metadata.js +239 -0
- package/.output/server/node_modules/mongodb/lib/cmap/metrics.js +62 -0
- package/.output/server/node_modules/mongodb/lib/cmap/stream_description.js +70 -0
- package/.output/server/node_modules/mongodb/lib/cmap/wire_protocol/compression.js +163 -0
- package/.output/server/node_modules/mongodb/lib/cmap/wire_protocol/constants.js +19 -0
- package/.output/server/node_modules/mongodb/lib/cmap/wire_protocol/on_data.js +112 -0
- package/.output/server/node_modules/mongodb/lib/cmap/wire_protocol/on_demand/document.js +222 -0
- package/.output/server/node_modules/mongodb/lib/cmap/wire_protocol/responses.js +315 -0
- package/.output/server/node_modules/mongodb/lib/cmap/wire_protocol/shared.js +35 -0
- package/.output/server/node_modules/mongodb/lib/collection.js +751 -0
- package/.output/server/node_modules/mongodb/lib/connection_string.js +1091 -0
- package/.output/server/node_modules/mongodb/lib/constants.js +170 -0
- package/.output/server/node_modules/mongodb/lib/cursor/abstract_cursor.js +941 -0
- package/.output/server/node_modules/mongodb/lib/cursor/aggregation_cursor.js +164 -0
- package/.output/server/node_modules/mongodb/lib/cursor/change_stream_cursor.js +104 -0
- package/.output/server/node_modules/mongodb/lib/cursor/client_bulk_write_cursor.js +52 -0
- package/.output/server/node_modules/mongodb/lib/cursor/explainable_cursor.js +36 -0
- package/.output/server/node_modules/mongodb/lib/cursor/find_cursor.js +388 -0
- package/.output/server/node_modules/mongodb/lib/cursor/list_collections_cursor.js +34 -0
- package/.output/server/node_modules/mongodb/lib/cursor/list_indexes_cursor.js +32 -0
- package/.output/server/node_modules/mongodb/lib/cursor/list_search_indexes_cursor.js +14 -0
- package/.output/server/node_modules/mongodb/lib/cursor/run_command_cursor.js +94 -0
- package/.output/server/node_modules/mongodb/lib/db.js +420 -0
- package/.output/server/node_modules/mongodb/lib/deps.js +125 -0
- package/.output/server/node_modules/mongodb/lib/encrypter.js +106 -0
- package/.output/server/node_modules/mongodb/lib/error.js +1383 -0
- package/.output/server/node_modules/mongodb/lib/explain.js +59 -0
- package/.output/server/node_modules/mongodb/lib/gridfs/download.js +305 -0
- package/.output/server/node_modules/mongodb/lib/gridfs/index.js +164 -0
- package/.output/server/node_modules/mongodb/lib/gridfs/upload.js +364 -0
- package/.output/server/node_modules/mongodb/lib/index.js +195 -0
- package/.output/server/node_modules/mongodb/lib/mongo_client.js +566 -0
- package/.output/server/node_modules/mongodb/lib/mongo_client_auth_providers.js +86 -0
- package/.output/server/node_modules/mongodb/lib/mongo_logger.js +649 -0
- package/.output/server/node_modules/mongodb/lib/mongo_types.js +57 -0
- package/.output/server/node_modules/mongodb/lib/operations/aggregate.js +93 -0
- package/.output/server/node_modules/mongodb/lib/operations/client_bulk_write/client_bulk_write.js +51 -0
- package/.output/server/node_modules/mongodb/lib/operations/client_bulk_write/command_builder.js +340 -0
- package/.output/server/node_modules/mongodb/lib/operations/client_bulk_write/executor.js +120 -0
- package/.output/server/node_modules/mongodb/lib/operations/client_bulk_write/results_merger.js +204 -0
- package/.output/server/node_modules/mongodb/lib/operations/command.js +83 -0
- package/.output/server/node_modules/mongodb/lib/operations/count.js +45 -0
- package/.output/server/node_modules/mongodb/lib/operations/create_collection.js +110 -0
- package/.output/server/node_modules/mongodb/lib/operations/delete.js +125 -0
- package/.output/server/node_modules/mongodb/lib/operations/distinct.js +61 -0
- package/.output/server/node_modules/mongodb/lib/operations/drop.js +94 -0
- package/.output/server/node_modules/mongodb/lib/operations/estimated_document_count.js +41 -0
- package/.output/server/node_modules/mongodb/lib/operations/execute_operation.js +236 -0
- package/.output/server/node_modules/mongodb/lib/operations/find.js +148 -0
- package/.output/server/node_modules/mongodb/lib/operations/find_and_modify.js +158 -0
- package/.output/server/node_modules/mongodb/lib/operations/get_more.js +62 -0
- package/.output/server/node_modules/mongodb/lib/operations/indexes.js +186 -0
- package/.output/server/node_modules/mongodb/lib/operations/insert.js +70 -0
- package/.output/server/node_modules/mongodb/lib/operations/kill_cursors.js +43 -0
- package/.output/server/node_modules/mongodb/lib/operations/list_collections.js +53 -0
- package/.output/server/node_modules/mongodb/lib/operations/list_databases.js +40 -0
- package/.output/server/node_modules/mongodb/lib/operations/operation.js +102 -0
- package/.output/server/node_modules/mongodb/lib/operations/profiling_level.js +43 -0
- package/.output/server/node_modules/mongodb/lib/operations/remove_user.js +27 -0
- package/.output/server/node_modules/mongodb/lib/operations/rename.js +38 -0
- package/.output/server/node_modules/mongodb/lib/operations/run_command.js +47 -0
- package/.output/server/node_modules/mongodb/lib/operations/search_indexes/create.js +33 -0
- package/.output/server/node_modules/mongodb/lib/operations/search_indexes/drop.js +43 -0
- package/.output/server/node_modules/mongodb/lib/operations/search_indexes/update.js +35 -0
- package/.output/server/node_modules/mongodb/lib/operations/set_profiling_level.js +53 -0
- package/.output/server/node_modules/mongodb/lib/operations/stats.js +27 -0
- package/.output/server/node_modules/mongodb/lib/operations/update.js +188 -0
- package/.output/server/node_modules/mongodb/lib/operations/validate_collection.js +37 -0
- package/.output/server/node_modules/mongodb/lib/read_concern.js +73 -0
- package/.output/server/node_modules/mongodb/lib/read_preference.js +195 -0
- package/.output/server/node_modules/mongodb/lib/resource_management.js +58 -0
- package/.output/server/node_modules/mongodb/lib/sdam/common.js +49 -0
- package/.output/server/node_modules/mongodb/lib/sdam/events.js +146 -0
- package/.output/server/node_modules/mongodb/lib/sdam/monitor.js +544 -0
- package/.output/server/node_modules/mongodb/lib/sdam/server.js +392 -0
- package/.output/server/node_modules/mongodb/lib/sdam/server_description.js +204 -0
- package/.output/server/node_modules/mongodb/lib/sdam/server_selection.js +231 -0
- package/.output/server/node_modules/mongodb/lib/sdam/server_selection_events.js +85 -0
- package/.output/server/node_modules/mongodb/lib/sdam/srv_polling.js +108 -0
- package/.output/server/node_modules/mongodb/lib/sdam/topology.js +694 -0
- package/.output/server/node_modules/mongodb/lib/sdam/topology_description.js +383 -0
- package/.output/server/node_modules/mongodb/lib/sessions.js +827 -0
- package/.output/server/node_modules/mongodb/lib/sort.js +103 -0
- package/.output/server/node_modules/mongodb/lib/timeout.js +296 -0
- package/.output/server/node_modules/mongodb/lib/transactions.js +146 -0
- package/.output/server/node_modules/mongodb/lib/utils.js +1203 -0
- package/.output/server/node_modules/mongodb/lib/write_concern.js +100 -0
- package/.output/server/node_modules/mongodb/package.json +178 -0
- package/.output/server/node_modules/mongodb-connection-string-url/lib/index.js +213 -0
- package/.output/server/node_modules/mongodb-connection-string-url/lib/redact.js +86 -0
- package/.output/server/node_modules/mongodb-connection-string-url/package.json +62 -0
- package/.output/server/node_modules/mongoose/index.js +64 -0
- package/.output/server/node_modules/mongoose/lib/aggregate.js +1245 -0
- package/.output/server/node_modules/mongoose/lib/browserDocument.js +101 -0
- package/.output/server/node_modules/mongoose/lib/cast/bigint.js +46 -0
- package/.output/server/node_modules/mongoose/lib/cast/boolean.js +32 -0
- package/.output/server/node_modules/mongoose/lib/cast/date.js +41 -0
- package/.output/server/node_modules/mongoose/lib/cast/decimal128.js +39 -0
- package/.output/server/node_modules/mongoose/lib/cast/double.js +50 -0
- package/.output/server/node_modules/mongoose/lib/cast/int32.js +36 -0
- package/.output/server/node_modules/mongoose/lib/cast/number.js +42 -0
- package/.output/server/node_modules/mongoose/lib/cast/objectid.js +29 -0
- package/.output/server/node_modules/mongoose/lib/cast/string.js +37 -0
- package/.output/server/node_modules/mongoose/lib/cast/uuid.js +78 -0
- package/.output/server/node_modules/mongoose/lib/cast.js +444 -0
- package/.output/server/node_modules/mongoose/lib/collection.js +321 -0
- package/.output/server/node_modules/mongoose/lib/connection.js +1850 -0
- package/.output/server/node_modules/mongoose/lib/connectionState.js +26 -0
- package/.output/server/node_modules/mongoose/lib/constants.js +73 -0
- package/.output/server/node_modules/mongoose/lib/cursor/aggregationCursor.js +476 -0
- package/.output/server/node_modules/mongoose/lib/cursor/changeStream.js +198 -0
- package/.output/server/node_modules/mongoose/lib/cursor/queryCursor.js +629 -0
- package/.output/server/node_modules/mongoose/lib/document.js +5512 -0
- package/.output/server/node_modules/mongoose/lib/documentProvider.js +30 -0
- package/.output/server/node_modules/mongoose/lib/driver.js +15 -0
- package/.output/server/node_modules/mongoose/lib/drivers/node-mongodb-native/bulkWriteResult.js +5 -0
- package/.output/server/node_modules/mongoose/lib/drivers/node-mongodb-native/collection.js +471 -0
- package/.output/server/node_modules/mongoose/lib/drivers/node-mongodb-native/connection.js +528 -0
- package/.output/server/node_modules/mongoose/lib/drivers/node-mongodb-native/index.js +10 -0
- package/.output/server/node_modules/mongoose/lib/error/bulkSaveIncompleteError.js +44 -0
- package/.output/server/node_modules/mongoose/lib/error/bulkWriteError.js +41 -0
- package/.output/server/node_modules/mongoose/lib/error/cast.js +158 -0
- package/.output/server/node_modules/mongoose/lib/error/createCollectionsError.js +26 -0
- package/.output/server/node_modules/mongoose/lib/error/divergentArray.js +40 -0
- package/.output/server/node_modules/mongoose/lib/error/eachAsyncMultiError.js +41 -0
- package/.output/server/node_modules/mongoose/lib/error/index.js +237 -0
- package/.output/server/node_modules/mongoose/lib/error/invalidSchemaOption.js +32 -0
- package/.output/server/node_modules/mongoose/lib/error/messages.js +47 -0
- package/.output/server/node_modules/mongoose/lib/error/missingSchema.js +33 -0
- package/.output/server/node_modules/mongoose/lib/error/mongooseError.js +13 -0
- package/.output/server/node_modules/mongoose/lib/error/notFound.js +47 -0
- package/.output/server/node_modules/mongoose/lib/error/objectExpected.js +31 -0
- package/.output/server/node_modules/mongoose/lib/error/objectParameter.js +32 -0
- package/.output/server/node_modules/mongoose/lib/error/overwriteModel.js +31 -0
- package/.output/server/node_modules/mongoose/lib/error/parallelSave.js +33 -0
- package/.output/server/node_modules/mongoose/lib/error/parallelValidate.js +33 -0
- package/.output/server/node_modules/mongoose/lib/error/serverSelection.js +62 -0
- package/.output/server/node_modules/mongoose/lib/error/setOptionError.js +103 -0
- package/.output/server/node_modules/mongoose/lib/error/strict.js +35 -0
- package/.output/server/node_modules/mongoose/lib/error/strictPopulate.js +31 -0
- package/.output/server/node_modules/mongoose/lib/error/syncIndexes.js +30 -0
- package/.output/server/node_modules/mongoose/lib/error/validation.js +105 -0
- package/.output/server/node_modules/mongoose/lib/error/validator.js +100 -0
- package/.output/server/node_modules/mongoose/lib/error/version.js +38 -0
- package/.output/server/node_modules/mongoose/lib/helpers/aggregate/prepareDiscriminatorPipeline.js +39 -0
- package/.output/server/node_modules/mongoose/lib/helpers/aggregate/stringifyFunctionOperators.js +50 -0
- package/.output/server/node_modules/mongoose/lib/helpers/arrayDepth.js +33 -0
- package/.output/server/node_modules/mongoose/lib/helpers/clone.js +236 -0
- package/.output/server/node_modules/mongoose/lib/helpers/common.js +127 -0
- package/.output/server/node_modules/mongoose/lib/helpers/createJSONSchemaTypeDefinition.js +24 -0
- package/.output/server/node_modules/mongoose/lib/helpers/cursor/eachAsync.js +225 -0
- package/.output/server/node_modules/mongoose/lib/helpers/discriminator/applyEmbeddedDiscriminators.js +36 -0
- package/.output/server/node_modules/mongoose/lib/helpers/discriminator/areDiscriminatorValuesEqual.js +16 -0
- package/.output/server/node_modules/mongoose/lib/helpers/discriminator/checkEmbeddedDiscriminatorKeyProjection.js +12 -0
- package/.output/server/node_modules/mongoose/lib/helpers/discriminator/getConstructor.js +29 -0
- package/.output/server/node_modules/mongoose/lib/helpers/discriminator/getDiscriminatorByValue.js +28 -0
- package/.output/server/node_modules/mongoose/lib/helpers/discriminator/getSchemaDiscriminatorByValue.js +27 -0
- package/.output/server/node_modules/mongoose/lib/helpers/discriminator/mergeDiscriminatorSchema.js +91 -0
- package/.output/server/node_modules/mongoose/lib/helpers/document/applyDefaults.js +132 -0
- package/.output/server/node_modules/mongoose/lib/helpers/document/applyTimestamps.js +105 -0
- package/.output/server/node_modules/mongoose/lib/helpers/document/applyVirtuals.js +146 -0
- package/.output/server/node_modules/mongoose/lib/helpers/document/cleanModifiedSubpaths.js +45 -0
- package/.output/server/node_modules/mongoose/lib/helpers/document/compile.js +238 -0
- package/.output/server/node_modules/mongoose/lib/helpers/document/getDeepestSubdocumentForPath.js +38 -0
- package/.output/server/node_modules/mongoose/lib/helpers/document/getEmbeddedDiscriminatorPath.js +53 -0
- package/.output/server/node_modules/mongoose/lib/helpers/document/handleSpreadDoc.js +35 -0
- package/.output/server/node_modules/mongoose/lib/helpers/each.js +25 -0
- package/.output/server/node_modules/mongoose/lib/helpers/error/combinePathErrors.js +22 -0
- package/.output/server/node_modules/mongoose/lib/helpers/firstKey.js +8 -0
- package/.output/server/node_modules/mongoose/lib/helpers/get.js +65 -0
- package/.output/server/node_modules/mongoose/lib/helpers/getConstructorName.js +16 -0
- package/.output/server/node_modules/mongoose/lib/helpers/getDefaultBulkwriteResult.js +18 -0
- package/.output/server/node_modules/mongoose/lib/helpers/getFunctionName.js +10 -0
- package/.output/server/node_modules/mongoose/lib/helpers/immediate.js +16 -0
- package/.output/server/node_modules/mongoose/lib/helpers/indexes/applySchemaCollation.js +13 -0
- package/.output/server/node_modules/mongoose/lib/helpers/indexes/decorateDiscriminatorIndexOptions.js +14 -0
- package/.output/server/node_modules/mongoose/lib/helpers/indexes/getRelatedIndexes.js +63 -0
- package/.output/server/node_modules/mongoose/lib/helpers/indexes/isDefaultIdIndex.js +18 -0
- package/.output/server/node_modules/mongoose/lib/helpers/indexes/isIndexEqual.js +96 -0
- package/.output/server/node_modules/mongoose/lib/helpers/indexes/isIndexSpecEqual.js +32 -0
- package/.output/server/node_modules/mongoose/lib/helpers/indexes/isTextIndex.js +16 -0
- package/.output/server/node_modules/mongoose/lib/helpers/indexes/isTimeseriesIndex.js +16 -0
- package/.output/server/node_modules/mongoose/lib/helpers/isAsyncFunction.js +9 -0
- package/.output/server/node_modules/mongoose/lib/helpers/isBsonType.js +15 -0
- package/.output/server/node_modules/mongoose/lib/helpers/isMongooseObject.js +22 -0
- package/.output/server/node_modules/mongoose/lib/helpers/isObject.js +16 -0
- package/.output/server/node_modules/mongoose/lib/helpers/isPOJO.js +12 -0
- package/.output/server/node_modules/mongoose/lib/helpers/isPromise.js +6 -0
- package/.output/server/node_modules/mongoose/lib/helpers/isSimpleValidator.js +22 -0
- package/.output/server/node_modules/mongoose/lib/helpers/minimize.js +41 -0
- package/.output/server/node_modules/mongoose/lib/helpers/model/applyDefaultsToPOJO.js +52 -0
- package/.output/server/node_modules/mongoose/lib/helpers/model/applyHooks.js +150 -0
- package/.output/server/node_modules/mongoose/lib/helpers/model/applyMethods.js +70 -0
- package/.output/server/node_modules/mongoose/lib/helpers/model/applyStaticHooks.js +80 -0
- package/.output/server/node_modules/mongoose/lib/helpers/model/applyStatics.js +13 -0
- package/.output/server/node_modules/mongoose/lib/helpers/model/castBulkWrite.js +326 -0
- package/.output/server/node_modules/mongoose/lib/helpers/model/decorateBulkWriteResult.js +8 -0
- package/.output/server/node_modules/mongoose/lib/helpers/model/discriminator.js +265 -0
- package/.output/server/node_modules/mongoose/lib/helpers/model/pushNestedArrayPaths.js +15 -0
- package/.output/server/node_modules/mongoose/lib/helpers/omitUndefined.js +20 -0
- package/.output/server/node_modules/mongoose/lib/helpers/parallelLimit.js +55 -0
- package/.output/server/node_modules/mongoose/lib/helpers/path/parentPaths.js +18 -0
- package/.output/server/node_modules/mongoose/lib/helpers/path/setDottedPath.js +33 -0
- package/.output/server/node_modules/mongoose/lib/helpers/pluralize.js +95 -0
- package/.output/server/node_modules/mongoose/lib/helpers/populate/assignRawDocsToIdStructure.js +136 -0
- package/.output/server/node_modules/mongoose/lib/helpers/populate/assignVals.js +360 -0
- package/.output/server/node_modules/mongoose/lib/helpers/populate/createPopulateQueryFilter.js +97 -0
- package/.output/server/node_modules/mongoose/lib/helpers/populate/getModelsMapForPopulate.js +766 -0
- package/.output/server/node_modules/mongoose/lib/helpers/populate/getSchemaTypes.js +229 -0
- package/.output/server/node_modules/mongoose/lib/helpers/populate/getVirtual.js +103 -0
- package/.output/server/node_modules/mongoose/lib/helpers/populate/leanPopulateMap.js +7 -0
- package/.output/server/node_modules/mongoose/lib/helpers/populate/lookupLocalFields.js +40 -0
- package/.output/server/node_modules/mongoose/lib/helpers/populate/markArraySubdocsPopulated.js +49 -0
- package/.output/server/node_modules/mongoose/lib/helpers/populate/modelNamesFromRefPath.js +66 -0
- package/.output/server/node_modules/mongoose/lib/helpers/populate/removeDeselectedForeignField.js +31 -0
- package/.output/server/node_modules/mongoose/lib/helpers/populate/setPopulatedVirtualValue.js +33 -0
- package/.output/server/node_modules/mongoose/lib/helpers/populate/skipPopulateValue.js +10 -0
- package/.output/server/node_modules/mongoose/lib/helpers/populate/validateRef.js +19 -0
- package/.output/server/node_modules/mongoose/lib/helpers/printJestWarning.js +21 -0
- package/.output/server/node_modules/mongoose/lib/helpers/processConnectionOptions.js +65 -0
- package/.output/server/node_modules/mongoose/lib/helpers/projection/applyProjection.js +83 -0
- package/.output/server/node_modules/mongoose/lib/helpers/projection/hasIncludedChildren.js +41 -0
- package/.output/server/node_modules/mongoose/lib/helpers/projection/isDefiningProjection.js +18 -0
- package/.output/server/node_modules/mongoose/lib/helpers/projection/isExclusive.js +37 -0
- package/.output/server/node_modules/mongoose/lib/helpers/projection/isInclusive.js +39 -0
- package/.output/server/node_modules/mongoose/lib/helpers/projection/isNestedProjection.js +8 -0
- package/.output/server/node_modules/mongoose/lib/helpers/projection/isPathExcluded.js +40 -0
- package/.output/server/node_modules/mongoose/lib/helpers/projection/isPathSelectedInclusive.js +28 -0
- package/.output/server/node_modules/mongoose/lib/helpers/projection/isSubpath.js +14 -0
- package/.output/server/node_modules/mongoose/lib/helpers/projection/parseProjection.js +33 -0
- package/.output/server/node_modules/mongoose/lib/helpers/promiseOrCallback.js +54 -0
- package/.output/server/node_modules/mongoose/lib/helpers/query/applyGlobalOption.js +29 -0
- package/.output/server/node_modules/mongoose/lib/helpers/query/cast$expr.js +289 -0
- package/.output/server/node_modules/mongoose/lib/helpers/query/castFilterPath.js +54 -0
- package/.output/server/node_modules/mongoose/lib/helpers/query/castUpdate.js +641 -0
- package/.output/server/node_modules/mongoose/lib/helpers/query/getEmbeddedDiscriminatorPath.js +103 -0
- package/.output/server/node_modules/mongoose/lib/helpers/query/handleImmutable.js +44 -0
- package/.output/server/node_modules/mongoose/lib/helpers/query/handleReadPreferenceAliases.js +23 -0
- package/.output/server/node_modules/mongoose/lib/helpers/query/hasDollarKeys.js +23 -0
- package/.output/server/node_modules/mongoose/lib/helpers/query/isOperator.js +14 -0
- package/.output/server/node_modules/mongoose/lib/helpers/query/sanitizeFilter.js +41 -0
- package/.output/server/node_modules/mongoose/lib/helpers/query/sanitizeProjection.js +14 -0
- package/.output/server/node_modules/mongoose/lib/helpers/query/selectPopulatedFields.js +62 -0
- package/.output/server/node_modules/mongoose/lib/helpers/query/trusted.js +13 -0
- package/.output/server/node_modules/mongoose/lib/helpers/schema/addAutoId.js +7 -0
- package/.output/server/node_modules/mongoose/lib/helpers/schema/applyBuiltinPlugins.js +12 -0
- package/.output/server/node_modules/mongoose/lib/helpers/schema/applyPlugins.js +55 -0
- package/.output/server/node_modules/mongoose/lib/helpers/schema/applyReadConcern.js +20 -0
- package/.output/server/node_modules/mongoose/lib/helpers/schema/applyWriteConcern.js +37 -0
- package/.output/server/node_modules/mongoose/lib/helpers/schema/cleanPositionalOperators.js +12 -0
- package/.output/server/node_modules/mongoose/lib/helpers/schema/getIndexes.js +177 -0
- package/.output/server/node_modules/mongoose/lib/helpers/schema/getKeysInSchemaOrder.js +28 -0
- package/.output/server/node_modules/mongoose/lib/helpers/schema/getPath.js +43 -0
- package/.output/server/node_modules/mongoose/lib/helpers/schema/getSubdocumentStrictValue.js +32 -0
- package/.output/server/node_modules/mongoose/lib/helpers/schema/handleIdOption.js +20 -0
- package/.output/server/node_modules/mongoose/lib/helpers/schema/handleTimestampOption.js +24 -0
- package/.output/server/node_modules/mongoose/lib/helpers/schema/idGetter.js +34 -0
- package/.output/server/node_modules/mongoose/lib/helpers/schema/merge.js +36 -0
- package/.output/server/node_modules/mongoose/lib/helpers/schematype/handleImmutable.js +50 -0
- package/.output/server/node_modules/mongoose/lib/helpers/setDefaultsOnInsert.js +161 -0
- package/.output/server/node_modules/mongoose/lib/helpers/specialProperties.js +3 -0
- package/.output/server/node_modules/mongoose/lib/helpers/symbols.js +20 -0
- package/.output/server/node_modules/mongoose/lib/helpers/timers.js +3 -0
- package/.output/server/node_modules/mongoose/lib/helpers/timestamps/setDocumentTimestamps.js +26 -0
- package/.output/server/node_modules/mongoose/lib/helpers/timestamps/setupTimestamps.js +110 -0
- package/.output/server/node_modules/mongoose/lib/helpers/topology/allServersUnknown.js +12 -0
- package/.output/server/node_modules/mongoose/lib/helpers/topology/isAtlas.js +31 -0
- package/.output/server/node_modules/mongoose/lib/helpers/topology/isSSLError.js +16 -0
- package/.output/server/node_modules/mongoose/lib/helpers/update/applyTimestampsToChildren.js +193 -0
- package/.output/server/node_modules/mongoose/lib/helpers/update/applyTimestampsToUpdate.js +130 -0
- package/.output/server/node_modules/mongoose/lib/helpers/update/castArrayFilters.js +113 -0
- package/.output/server/node_modules/mongoose/lib/helpers/update/decorateUpdateWithVersionKey.js +35 -0
- package/.output/server/node_modules/mongoose/lib/helpers/update/modifiedPaths.js +33 -0
- package/.output/server/node_modules/mongoose/lib/helpers/update/moveImmutableProperties.js +53 -0
- package/.output/server/node_modules/mongoose/lib/helpers/update/removeUnusedArrayFilters.js +32 -0
- package/.output/server/node_modules/mongoose/lib/helpers/update/updatedPathsByArrayFilter.js +27 -0
- package/.output/server/node_modules/mongoose/lib/helpers/updateValidators.js +247 -0
- package/.output/server/node_modules/mongoose/lib/index.js +17 -0
- package/.output/server/node_modules/mongoose/lib/internal.js +46 -0
- package/.output/server/node_modules/mongoose/lib/model.js +5208 -0
- package/.output/server/node_modules/mongoose/lib/modifiedPathsSnapshot.js +9 -0
- package/.output/server/node_modules/mongoose/lib/mongoose.js +1383 -0
- package/.output/server/node_modules/mongoose/lib/options/populateOptions.js +36 -0
- package/.output/server/node_modules/mongoose/lib/options/propertyOptions.js +8 -0
- package/.output/server/node_modules/mongoose/lib/options/saveOptions.js +16 -0
- package/.output/server/node_modules/mongoose/lib/options/schemaArrayOptions.js +78 -0
- package/.output/server/node_modules/mongoose/lib/options/schemaBufferOptions.js +38 -0
- package/.output/server/node_modules/mongoose/lib/options/schemaDateOptions.js +71 -0
- package/.output/server/node_modules/mongoose/lib/options/schemaDocumentArrayOptions.js +68 -0
- package/.output/server/node_modules/mongoose/lib/options/schemaMapOptions.js +43 -0
- package/.output/server/node_modules/mongoose/lib/options/schemaNumberOptions.js +101 -0
- package/.output/server/node_modules/mongoose/lib/options/schemaObjectIdOptions.js +64 -0
- package/.output/server/node_modules/mongoose/lib/options/schemaStringOptions.js +138 -0
- package/.output/server/node_modules/mongoose/lib/options/schemaSubdocumentOptions.js +66 -0
- package/.output/server/node_modules/mongoose/lib/options/schemaTypeOptions.js +244 -0
- package/.output/server/node_modules/mongoose/lib/options/schemaUnionOptions.js +32 -0
- package/.output/server/node_modules/mongoose/lib/options/virtualOptions.js +164 -0
- package/.output/server/node_modules/mongoose/lib/options.js +18 -0
- package/.output/server/node_modules/mongoose/lib/plugins/index.js +6 -0
- package/.output/server/node_modules/mongoose/lib/plugins/saveSubdocs.js +102 -0
- package/.output/server/node_modules/mongoose/lib/plugins/sharding.js +83 -0
- package/.output/server/node_modules/mongoose/lib/plugins/trackTransaction.js +85 -0
- package/.output/server/node_modules/mongoose/lib/plugins/validateBeforeSave.js +51 -0
- package/.output/server/node_modules/mongoose/lib/query.js +5693 -0
- package/.output/server/node_modules/mongoose/lib/queryHelpers.js +394 -0
- package/.output/server/node_modules/mongoose/lib/schema/array.js +744 -0
- package/.output/server/node_modules/mongoose/lib/schema/bigint.js +282 -0
- package/.output/server/node_modules/mongoose/lib/schema/boolean.js +332 -0
- package/.output/server/node_modules/mongoose/lib/schema/buffer.js +343 -0
- package/.output/server/node_modules/mongoose/lib/schema/date.js +467 -0
- package/.output/server/node_modules/mongoose/lib/schema/decimal128.js +263 -0
- package/.output/server/node_modules/mongoose/lib/schema/documentArray.js +701 -0
- package/.output/server/node_modules/mongoose/lib/schema/documentArrayElement.js +102 -0
- package/.output/server/node_modules/mongoose/lib/schema/double.js +246 -0
- package/.output/server/node_modules/mongoose/lib/schema/index.js +31 -0
- package/.output/server/node_modules/mongoose/lib/schema/int32.js +289 -0
- package/.output/server/node_modules/mongoose/lib/schema/map.js +201 -0
- package/.output/server/node_modules/mongoose/lib/schema/mixed.js +146 -0
- package/.output/server/node_modules/mongoose/lib/schema/number.js +498 -0
- package/.output/server/node_modules/mongoose/lib/schema/objectId.js +333 -0
- package/.output/server/node_modules/mongoose/lib/schema/operators/bitwise.js +38 -0
- package/.output/server/node_modules/mongoose/lib/schema/operators/exists.js +12 -0
- package/.output/server/node_modules/mongoose/lib/schema/operators/geospatial.js +107 -0
- package/.output/server/node_modules/mongoose/lib/schema/operators/helpers.js +32 -0
- package/.output/server/node_modules/mongoose/lib/schema/operators/text.js +39 -0
- package/.output/server/node_modules/mongoose/lib/schema/operators/type.js +20 -0
- package/.output/server/node_modules/mongoose/lib/schema/string.js +733 -0
- package/.output/server/node_modules/mongoose/lib/schema/subdocument.js +445 -0
- package/.output/server/node_modules/mongoose/lib/schema/symbols.js +5 -0
- package/.output/server/node_modules/mongoose/lib/schema/union.js +113 -0
- package/.output/server/node_modules/mongoose/lib/schema/uuid.js +326 -0
- package/.output/server/node_modules/mongoose/lib/schema.js +3185 -0
- package/.output/server/node_modules/mongoose/lib/schemaType.js +1853 -0
- package/.output/server/node_modules/mongoose/lib/stateMachine.js +232 -0
- package/.output/server/node_modules/mongoose/lib/types/array/index.js +119 -0
- package/.output/server/node_modules/mongoose/lib/types/array/isMongooseArray.js +5 -0
- package/.output/server/node_modules/mongoose/lib/types/array/methods/index.js +1096 -0
- package/.output/server/node_modules/mongoose/lib/types/arraySubdocument.js +208 -0
- package/.output/server/node_modules/mongoose/lib/types/buffer.js +294 -0
- package/.output/server/node_modules/mongoose/lib/types/decimal128.js +13 -0
- package/.output/server/node_modules/mongoose/lib/types/documentArray/index.js +113 -0
- package/.output/server/node_modules/mongoose/lib/types/documentArray/isMongooseDocumentArray.js +5 -0
- package/.output/server/node_modules/mongoose/lib/types/documentArray/methods/index.js +413 -0
- package/.output/server/node_modules/mongoose/lib/types/double.js +13 -0
- package/.output/server/node_modules/mongoose/lib/types/index.js +23 -0
- package/.output/server/node_modules/mongoose/lib/types/map.js +419 -0
- package/.output/server/node_modules/mongoose/lib/types/objectid.js +41 -0
- package/.output/server/node_modules/mongoose/lib/types/subdocument.js +492 -0
- package/.output/server/node_modules/mongoose/lib/types/uuid.js +13 -0
- package/.output/server/node_modules/mongoose/lib/utils.js +1043 -0
- package/.output/server/node_modules/mongoose/lib/validOptions.js +42 -0
- package/.output/server/node_modules/mongoose/lib/virtualType.js +204 -0
- package/.output/server/node_modules/mongoose/package.json +156 -0
- package/.output/server/node_modules/mpath/index.js +3 -0
- package/.output/server/node_modules/mpath/lib/index.js +336 -0
- package/.output/server/node_modules/mpath/lib/stringToParts.js +48 -0
- package/.output/server/node_modules/mpath/package.json +144 -0
- package/.output/server/node_modules/mquery/lib/collection/collection.js +45 -0
- package/.output/server/node_modules/mquery/lib/collection/index.js +13 -0
- package/.output/server/node_modules/mquery/lib/collection/node.js +114 -0
- package/.output/server/node_modules/mquery/lib/env.js +22 -0
- package/.output/server/node_modules/mquery/lib/mquery.js +2705 -0
- package/.output/server/node_modules/mquery/lib/permissions.js +78 -0
- package/.output/server/node_modules/mquery/lib/utils.js +297 -0
- package/.output/server/node_modules/mquery/package.json +38 -0
- package/.output/server/node_modules/ms/index.js +162 -0
- package/.output/server/node_modules/ms/package.json +38 -0
- package/.output/server/node_modules/punycode/package.json +58 -0
- package/.output/server/node_modules/punycode/punycode.js +443 -0
- package/.output/server/node_modules/sift/index.js +4 -0
- package/.output/server/node_modules/sift/lib/index.js +781 -0
- package/.output/server/node_modules/sift/package.json +61 -0
- package/.output/server/node_modules/smart-buffer/build/smartbuffer.js +1233 -0
- package/.output/server/node_modules/smart-buffer/build/utils.js +108 -0
- package/.output/server/node_modules/smart-buffer/package.json +81 -0
- package/.output/server/node_modules/socks/build/client/socksclient.js +793 -0
- package/.output/server/node_modules/socks/build/common/constants.js +108 -0
- package/.output/server/node_modules/socks/build/common/helpers.js +167 -0
- package/.output/server/node_modules/socks/build/common/receivebuffer.js +43 -0
- package/.output/server/node_modules/socks/build/common/util.js +25 -0
- package/.output/server/node_modules/socks/build/index.js +18 -0
- package/.output/server/node_modules/socks/package.json +58 -0
- package/.output/server/node_modules/source-map-js/lib/array-set.js +121 -0
- package/.output/server/node_modules/source-map-js/lib/base64-vlq.js +140 -0
- package/.output/server/node_modules/source-map-js/lib/base64.js +67 -0
- package/.output/server/node_modules/source-map-js/lib/binary-search.js +111 -0
- package/.output/server/node_modules/source-map-js/lib/mapping-list.js +79 -0
- package/.output/server/node_modules/source-map-js/lib/quick-sort.js +132 -0
- package/.output/server/node_modules/source-map-js/lib/source-map-consumer.js +1188 -0
- package/.output/server/node_modules/source-map-js/lib/source-map-generator.js +444 -0
- package/.output/server/node_modules/source-map-js/lib/source-node.js +413 -0
- package/.output/server/node_modules/source-map-js/lib/util.js +594 -0
- package/.output/server/node_modules/source-map-js/package.json +71 -0
- package/.output/server/node_modules/source-map-js/source-map.js +8 -0
- package/.output/server/node_modules/sparse-bitfield/index.js +95 -0
- package/.output/server/node_modules/sparse-bitfield/package.json +27 -0
- package/.output/server/node_modules/supports-color/index.js +202 -0
- package/.output/server/node_modules/supports-color/package.json +64 -0
- package/.output/server/node_modules/tailwindcss/dist/chunk-X4GG3EDV.mjs +1 -0
- package/.output/server/node_modules/tailwindcss/dist/colors.mjs +1 -0
- package/.output/server/node_modules/tailwindcss/package.json +89 -0
- package/.output/server/node_modules/tr46/index.js +344 -0
- package/.output/server/node_modules/tr46/lib/mappingTable.json +1 -0
- package/.output/server/node_modules/tr46/lib/regexes.js +29 -0
- package/.output/server/node_modules/tr46/lib/statusMapping.js +9 -0
- package/.output/server/node_modules/tr46/package.json +44 -0
- package/.output/server/node_modules/ufo/dist/index.mjs +645 -0
- package/.output/server/node_modules/ufo/package.json +48 -0
- package/.output/server/node_modules/unhead/dist/index.mjs +9 -0
- package/.output/server/node_modules/unhead/dist/parser.mjs +508 -0
- package/.output/server/node_modules/unhead/dist/plugins.mjs +101 -0
- package/.output/server/node_modules/unhead/dist/scripts.mjs +30 -0
- package/.output/server/node_modules/unhead/dist/server.mjs +180 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.0eF0fa-Y.mjs +236 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.B5FWS6X0.mjs +207 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.BYvz9V1x.mjs +43 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.BnoAbrHA.mjs +269 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.CbpEuj3y.mjs +71 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.Chhckluj.mjs +166 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.Ct24BOby.mjs +182 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.DQc16pHI.mjs +196 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead._ybhDo-G.mjs +44 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.yem5I2v_.mjs +38 -0
- package/.output/server/node_modules/unhead/dist/utils.mjs +5 -0
- package/.output/server/node_modules/unhead/package.json +105 -0
- package/.output/server/node_modules/vue/dist/vue.cjs.js +80 -0
- package/.output/server/node_modules/vue/dist/vue.cjs.prod.js +66 -0
- package/.output/server/node_modules/vue/index.js +7 -0
- package/.output/server/node_modules/vue/index.mjs +1 -0
- package/.output/server/node_modules/vue/package.json +112 -0
- package/.output/server/node_modules/vue/server-renderer/index.mjs +1 -0
- package/.output/server/node_modules/vue-bundle-renderer/dist/runtime.mjs +301 -0
- package/.output/server/node_modules/vue-bundle-renderer/package.json +55 -0
- package/.output/server/node_modules/webidl-conversions/lib/index.js +450 -0
- package/.output/server/node_modules/webidl-conversions/package.json +35 -0
- package/.output/server/node_modules/whatwg-url/index.js +27 -0
- package/.output/server/node_modules/whatwg-url/lib/Function.js +42 -0
- package/.output/server/node_modules/whatwg-url/lib/URL-impl.js +233 -0
- package/.output/server/node_modules/whatwg-url/lib/URL.js +499 -0
- package/.output/server/node_modules/whatwg-url/lib/URLSearchParams-impl.js +135 -0
- package/.output/server/node_modules/whatwg-url/lib/URLSearchParams.js +505 -0
- package/.output/server/node_modules/whatwg-url/lib/encoding.js +16 -0
- package/.output/server/node_modules/whatwg-url/lib/infra.js +26 -0
- package/.output/server/node_modules/whatwg-url/lib/percent-encoding.js +142 -0
- package/.output/server/node_modules/whatwg-url/lib/url-state-machine.js +1274 -0
- package/.output/server/node_modules/whatwg-url/lib/urlencoded.js +89 -0
- package/.output/server/node_modules/whatwg-url/lib/utils.js +190 -0
- package/.output/server/node_modules/whatwg-url/package.json +53 -0
- package/.output/server/node_modules/whatwg-url/webidl2js-wrapper.js +7 -0
- package/.output/server/node_modules/zod/index.js +4 -0
- package/.output/server/node_modules/zod/package.json +135 -0
- package/.output/server/node_modules/zod/v4/classic/checks.js +1 -0
- package/.output/server/node_modules/zod/v4/classic/coerce.js +17 -0
- package/.output/server/node_modules/zod/v4/classic/compat.js +31 -0
- package/.output/server/node_modules/zod/v4/classic/errors.js +48 -0
- package/.output/server/node_modules/zod/v4/classic/external.js +20 -0
- package/.output/server/node_modules/zod/v4/classic/from-json-schema.js +584 -0
- package/.output/server/node_modules/zod/v4/classic/index.js +4 -0
- package/.output/server/node_modules/zod/v4/classic/iso.js +30 -0
- package/.output/server/node_modules/zod/v4/classic/package.json +6 -0
- package/.output/server/node_modules/zod/v4/classic/parse.js +15 -0
- package/.output/server/node_modules/zod/v4/classic/schemas.js +1157 -0
- package/.output/server/node_modules/zod/v4/core/api.js +1082 -0
- package/.output/server/node_modules/zod/v4/core/checks.js +575 -0
- package/.output/server/node_modules/zod/v4/core/core.js +76 -0
- package/.output/server/node_modules/zod/v4/core/doc.js +35 -0
- package/.output/server/node_modules/zod/v4/core/errors.js +182 -0
- package/.output/server/node_modules/zod/v4/core/index.js +16 -0
- package/.output/server/node_modules/zod/v4/core/json-schema-generator.js +95 -0
- package/.output/server/node_modules/zod/v4/core/json-schema-processors.js +605 -0
- package/.output/server/node_modules/zod/v4/core/json-schema.js +1 -0
- package/.output/server/node_modules/zod/v4/core/package.json +6 -0
- package/.output/server/node_modules/zod/v4/core/parse.js +93 -0
- package/.output/server/node_modules/zod/v4/core/regexes.js +133 -0
- package/.output/server/node_modules/zod/v4/core/registries.js +51 -0
- package/.output/server/node_modules/zod/v4/core/schemas.js +2093 -0
- package/.output/server/node_modules/zod/v4/core/to-json-schema.js +437 -0
- package/.output/server/node_modules/zod/v4/core/util.js +651 -0
- package/.output/server/node_modules/zod/v4/core/versions.js +5 -0
- package/.output/server/node_modules/zod/v4/index.js +3 -0
- package/.output/server/node_modules/zod/v4/locales/ar.js +106 -0
- package/.output/server/node_modules/zod/v4/locales/az.js +105 -0
- package/.output/server/node_modules/zod/v4/locales/be.js +156 -0
- package/.output/server/node_modules/zod/v4/locales/bg.js +120 -0
- package/.output/server/node_modules/zod/v4/locales/ca.js +107 -0
- package/.output/server/node_modules/zod/v4/locales/cs.js +111 -0
- package/.output/server/node_modules/zod/v4/locales/da.js +115 -0
- package/.output/server/node_modules/zod/v4/locales/de.js +108 -0
- package/.output/server/node_modules/zod/v4/locales/en.js +109 -0
- package/.output/server/node_modules/zod/v4/locales/eo.js +109 -0
- package/.output/server/node_modules/zod/v4/locales/es.js +132 -0
- package/.output/server/node_modules/zod/v4/locales/fa.js +114 -0
- package/.output/server/node_modules/zod/v4/locales/fi.js +112 -0
- package/.output/server/node_modules/zod/v4/locales/fr-CA.js +107 -0
- package/.output/server/node_modules/zod/v4/locales/fr.js +108 -0
- package/.output/server/node_modules/zod/v4/locales/he.js +214 -0
- package/.output/server/node_modules/zod/v4/locales/hu.js +108 -0
- package/.output/server/node_modules/zod/v4/locales/hy.js +147 -0
- package/.output/server/node_modules/zod/v4/locales/id.js +106 -0
- package/.output/server/node_modules/zod/v4/locales/index.js +49 -0
- package/.output/server/node_modules/zod/v4/locales/is.js +109 -0
- package/.output/server/node_modules/zod/v4/locales/it.js +108 -0
- package/.output/server/node_modules/zod/v4/locales/ja.js +107 -0
- package/.output/server/node_modules/zod/v4/locales/ka.js +112 -0
- package/.output/server/node_modules/zod/v4/locales/kh.js +5 -0
- package/.output/server/node_modules/zod/v4/locales/km.js +110 -0
- package/.output/server/node_modules/zod/v4/locales/ko.js +111 -0
- package/.output/server/node_modules/zod/v4/locales/lt.js +203 -0
- package/.output/server/node_modules/zod/v4/locales/mk.js +109 -0
- package/.output/server/node_modules/zod/v4/locales/ms.js +107 -0
- package/.output/server/node_modules/zod/v4/locales/nl.js +110 -0
- package/.output/server/node_modules/zod/v4/locales/no.js +108 -0
- package/.output/server/node_modules/zod/v4/locales/ota.js +109 -0
- package/.output/server/node_modules/zod/v4/locales/package.json +6 -0
- package/.output/server/node_modules/zod/v4/locales/pl.js +109 -0
- package/.output/server/node_modules/zod/v4/locales/ps.js +114 -0
- package/.output/server/node_modules/zod/v4/locales/pt.js +108 -0
- package/.output/server/node_modules/zod/v4/locales/ru.js +156 -0
- package/.output/server/node_modules/zod/v4/locales/sl.js +109 -0
- package/.output/server/node_modules/zod/v4/locales/sv.js +110 -0
- package/.output/server/node_modules/zod/v4/locales/ta.js +110 -0
- package/.output/server/node_modules/zod/v4/locales/th.js +110 -0
- package/.output/server/node_modules/zod/v4/locales/tr.js +105 -0
- package/.output/server/node_modules/zod/v4/locales/ua.js +5 -0
- package/.output/server/node_modules/zod/v4/locales/uk.js +108 -0
- package/.output/server/node_modules/zod/v4/locales/ur.js +110 -0
- package/.output/server/node_modules/zod/v4/locales/uz.js +109 -0
- package/.output/server/node_modules/zod/v4/locales/vi.js +108 -0
- package/.output/server/node_modules/zod/v4/locales/yo.js +107 -0
- package/.output/server/node_modules/zod/v4/locales/zh-CN.js +109 -0
- package/.output/server/node_modules/zod/v4/locales/zh-TW.js +107 -0
- package/.output/server/node_modules/zod/v4/package.json +6 -0
- package/.output/server/package.json +53 -0
- package/README.md +131 -0
- package/app/app.vue +7 -0
- package/app/assets/css/main.css +2 -0
- package/app/components/StudioEditor.vue +114 -0
- package/app/components/StudioOutput.vue +43 -0
- package/app/components/ZodMongooseStudio.vue +121 -0
- package/app/pages/index.vue +3 -0
- package/app/plugins/monaco.client.ts +14 -0
- package/bin/index.mjs +69 -0
- package/nuxt.config.ts +18 -0
- package/package.json +49 -0
- package/server/api/parse.post.ts +90 -0
- package/server/api/resolve.get.ts +38 -0
- package/server/middleware/security.ts +40 -0
|
@@ -0,0 +1,1293 @@
|
|
|
1
|
+
import { d as defineEventHandler, u as useRuntimeConfig, r as readBody, c as createError } from '../../nitro/nitro.mjs';
|
|
2
|
+
import vm from 'node:vm';
|
|
3
|
+
import { transformSync } from 'esbuild';
|
|
4
|
+
import util from 'node:util';
|
|
5
|
+
import * as zod from 'zod';
|
|
6
|
+
import * as v4$1 from 'zod/v4';
|
|
7
|
+
import 'node:http';
|
|
8
|
+
import 'node:https';
|
|
9
|
+
import 'node:events';
|
|
10
|
+
import 'node:buffer';
|
|
11
|
+
import 'node:fs';
|
|
12
|
+
import 'node:path';
|
|
13
|
+
import 'node:crypto';
|
|
14
|
+
import 'node:url';
|
|
15
|
+
import '@iconify/utils';
|
|
16
|
+
import 'consola';
|
|
17
|
+
|
|
18
|
+
function _mergeNamespaces(n, m) {
|
|
19
|
+
for (var i = 0; i < m.length; i++) {
|
|
20
|
+
const e = m[i];
|
|
21
|
+
if (typeof e !== 'string' && !Array.isArray(e)) { for (const k in e) {
|
|
22
|
+
if (k !== 'default' && !(k in n)) {
|
|
23
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
24
|
+
if (d) {
|
|
25
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function () { return e[k]; }
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
} }
|
|
32
|
+
}
|
|
33
|
+
return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { value: 'Module' }));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function getDefaultExportFromNamespaceIfNotNamed (n) {
|
|
37
|
+
return n && Object.prototype.hasOwnProperty.call(n, 'default') && Object.keys(n).length === 1 ? n['default'] : n;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
var dist = {};
|
|
41
|
+
|
|
42
|
+
const require$$0 = /*@__PURE__*/getDefaultExportFromNamespaceIfNotNamed(v4$1);
|
|
43
|
+
|
|
44
|
+
var v4 = require$$0;
|
|
45
|
+
|
|
46
|
+
//#region src/utils.ts
|
|
47
|
+
function flatHooks(configHooks, hooks = {}, parentName) {
|
|
48
|
+
for (const key in configHooks) {
|
|
49
|
+
const subHook = configHooks[key];
|
|
50
|
+
const name = parentName ? `${parentName}:${key}` : key;
|
|
51
|
+
if (typeof subHook === "object" && subHook !== null) flatHooks(subHook, hooks, name);
|
|
52
|
+
else if (typeof subHook === "function") hooks[name] = subHook;
|
|
53
|
+
}
|
|
54
|
+
return hooks;
|
|
55
|
+
}
|
|
56
|
+
const createTask = /* @__PURE__ */ (() => {
|
|
57
|
+
if (console.createTask) return console.createTask;
|
|
58
|
+
const defaultTask = { run: (fn) => fn() };
|
|
59
|
+
return () => defaultTask;
|
|
60
|
+
})();
|
|
61
|
+
function callHooks(hooks, args, startIndex, task) {
|
|
62
|
+
for (let i = startIndex; i < hooks.length; i += 1) try {
|
|
63
|
+
const result = task ? task.run(() => hooks[i](...args)) : hooks[i](...args);
|
|
64
|
+
if (result instanceof Promise) return result.then(() => callHooks(hooks, args, i + 1, task));
|
|
65
|
+
} catch (error) {
|
|
66
|
+
return Promise.reject(error);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
function serialTaskCaller(hooks, args, name) {
|
|
70
|
+
if (hooks.length > 0) return callHooks(hooks, args, 0, createTask(name));
|
|
71
|
+
}
|
|
72
|
+
function parallelTaskCaller(hooks, args, name) {
|
|
73
|
+
if (hooks.length > 0) {
|
|
74
|
+
const task = createTask(name);
|
|
75
|
+
return Promise.all(hooks.map((hook) => task.run(() => hook(...args))));
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
function callEachWith(callbacks, arg0) {
|
|
79
|
+
for (const callback of [...callbacks]) callback(arg0);
|
|
80
|
+
}
|
|
81
|
+
//#endregion
|
|
82
|
+
//#region src/hookable.ts
|
|
83
|
+
var Hookable = class {
|
|
84
|
+
_hooks;
|
|
85
|
+
_before;
|
|
86
|
+
_after;
|
|
87
|
+
_deprecatedHooks;
|
|
88
|
+
_deprecatedMessages;
|
|
89
|
+
constructor() {
|
|
90
|
+
this._hooks = {};
|
|
91
|
+
this._before = void 0;
|
|
92
|
+
this._after = void 0;
|
|
93
|
+
this._deprecatedMessages = void 0;
|
|
94
|
+
this._deprecatedHooks = {};
|
|
95
|
+
this.hook = this.hook.bind(this);
|
|
96
|
+
this.callHook = this.callHook.bind(this);
|
|
97
|
+
this.callHookWith = this.callHookWith.bind(this);
|
|
98
|
+
}
|
|
99
|
+
hook(name, function_, options = {}) {
|
|
100
|
+
if (!name || typeof function_ !== "function") return () => {};
|
|
101
|
+
const originalName = name;
|
|
102
|
+
let dep;
|
|
103
|
+
while (this._deprecatedHooks[name]) {
|
|
104
|
+
dep = this._deprecatedHooks[name];
|
|
105
|
+
name = dep.to;
|
|
106
|
+
}
|
|
107
|
+
if (dep && !options.allowDeprecated) {
|
|
108
|
+
let message = dep.message;
|
|
109
|
+
if (!message) message = `${originalName} hook has been deprecated` + (dep.to ? `, please use ${dep.to}` : "");
|
|
110
|
+
if (!this._deprecatedMessages) this._deprecatedMessages = /* @__PURE__ */ new Set();
|
|
111
|
+
if (!this._deprecatedMessages.has(message)) {
|
|
112
|
+
console.warn(message);
|
|
113
|
+
this._deprecatedMessages.add(message);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
if (!function_.name) try {
|
|
117
|
+
Object.defineProperty(function_, "name", {
|
|
118
|
+
get: () => "_" + name.replace(/\W+/g, "_") + "_hook_cb",
|
|
119
|
+
configurable: true
|
|
120
|
+
});
|
|
121
|
+
} catch {}
|
|
122
|
+
this._hooks[name] = this._hooks[name] || [];
|
|
123
|
+
this._hooks[name].push(function_);
|
|
124
|
+
return () => {
|
|
125
|
+
if (function_) {
|
|
126
|
+
this.removeHook(name, function_);
|
|
127
|
+
function_ = void 0;
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
hookOnce(name, function_) {
|
|
132
|
+
let _unreg;
|
|
133
|
+
let _function = (...arguments_) => {
|
|
134
|
+
if (typeof _unreg === "function") _unreg();
|
|
135
|
+
_unreg = void 0;
|
|
136
|
+
_function = void 0;
|
|
137
|
+
return function_(...arguments_);
|
|
138
|
+
};
|
|
139
|
+
_unreg = this.hook(name, _function);
|
|
140
|
+
return _unreg;
|
|
141
|
+
}
|
|
142
|
+
removeHook(name, function_) {
|
|
143
|
+
const hooks = this._hooks[name];
|
|
144
|
+
if (hooks) {
|
|
145
|
+
const index = hooks.indexOf(function_);
|
|
146
|
+
if (index !== -1) hooks.splice(index, 1);
|
|
147
|
+
if (hooks.length === 0) this._hooks[name] = void 0;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
clearHook(name) {
|
|
151
|
+
this._hooks[name] = void 0;
|
|
152
|
+
}
|
|
153
|
+
deprecateHook(name, deprecated) {
|
|
154
|
+
this._deprecatedHooks[name] = typeof deprecated === "string" ? { to: deprecated } : deprecated;
|
|
155
|
+
const _hooks = this._hooks[name] || [];
|
|
156
|
+
this._hooks[name] = void 0;
|
|
157
|
+
for (const hook of _hooks) this.hook(name, hook);
|
|
158
|
+
}
|
|
159
|
+
deprecateHooks(deprecatedHooks) {
|
|
160
|
+
for (const name in deprecatedHooks) this.deprecateHook(name, deprecatedHooks[name]);
|
|
161
|
+
}
|
|
162
|
+
addHooks(configHooks) {
|
|
163
|
+
const hooks = flatHooks(configHooks);
|
|
164
|
+
const removeFns = Object.keys(hooks).map((key) => this.hook(key, hooks[key]));
|
|
165
|
+
return () => {
|
|
166
|
+
for (const unreg of removeFns) unreg();
|
|
167
|
+
removeFns.length = 0;
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
removeHooks(configHooks) {
|
|
171
|
+
const hooks = flatHooks(configHooks);
|
|
172
|
+
for (const key in hooks) this.removeHook(key, hooks[key]);
|
|
173
|
+
}
|
|
174
|
+
removeAllHooks() {
|
|
175
|
+
this._hooks = {};
|
|
176
|
+
}
|
|
177
|
+
callHook(name, ...args) {
|
|
178
|
+
return this.callHookWith(serialTaskCaller, name, args);
|
|
179
|
+
}
|
|
180
|
+
callHookParallel(name, ...args) {
|
|
181
|
+
return this.callHookWith(parallelTaskCaller, name, args);
|
|
182
|
+
}
|
|
183
|
+
callHookWith(caller, name, args) {
|
|
184
|
+
const event = this._before || this._after ? {
|
|
185
|
+
name,
|
|
186
|
+
args,
|
|
187
|
+
context: {}
|
|
188
|
+
} : void 0;
|
|
189
|
+
if (this._before) callEachWith(this._before, event);
|
|
190
|
+
const result = caller(this._hooks[name] ? [...this._hooks[name]] : [], args, name);
|
|
191
|
+
if (result instanceof Promise) return result.finally(() => {
|
|
192
|
+
if (this._after && event) callEachWith(this._after, event);
|
|
193
|
+
});
|
|
194
|
+
if (this._after && event) callEachWith(this._after, event);
|
|
195
|
+
return result;
|
|
196
|
+
}
|
|
197
|
+
beforeEach(function_) {
|
|
198
|
+
this._before = this._before || [];
|
|
199
|
+
this._before.push(function_);
|
|
200
|
+
return () => {
|
|
201
|
+
if (this._before !== void 0) {
|
|
202
|
+
const index = this._before.indexOf(function_);
|
|
203
|
+
if (index !== -1) this._before.splice(index, 1);
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
afterEach(function_) {
|
|
208
|
+
this._after = this._after || [];
|
|
209
|
+
this._after.push(function_);
|
|
210
|
+
return () => {
|
|
211
|
+
if (this._after !== void 0) {
|
|
212
|
+
const index = this._after.indexOf(function_);
|
|
213
|
+
if (index !== -1) this._after.splice(index, 1);
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
function createHooks() {
|
|
219
|
+
return new Hookable();
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
const hooks = createHooks();
|
|
223
|
+
/**
|
|
224
|
+
* Synchronous hook caller for Hookable.
|
|
225
|
+
*/
|
|
226
|
+
function callHookSync(name, ...args) {
|
|
227
|
+
hooks.callHookWith((callbacks, args) => {
|
|
228
|
+
for (const callback of callbacks) {
|
|
229
|
+
callback(...args);
|
|
230
|
+
}
|
|
231
|
+
}, name, args);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* This securely stores our Mongoose metadata alongside the Zod schema instances
|
|
236
|
+
* without polluting the actual validation logic.
|
|
237
|
+
*/
|
|
238
|
+
const mongooseRegistry = v4.z.registry();
|
|
239
|
+
/**
|
|
240
|
+
* A clean wrapper to attach Mongoose metadata to any Zod schema.
|
|
241
|
+
*/
|
|
242
|
+
function withMongoose(schema, meta) {
|
|
243
|
+
callHookSync('registry:get:before', { schema });
|
|
244
|
+
const existing = mongooseRegistry.get(schema) || {};
|
|
245
|
+
callHookSync('registry:get', { schema, meta: existing });
|
|
246
|
+
const merged = { ...existing, ...meta };
|
|
247
|
+
callHookSync('registry:add', { schema, meta: merged });
|
|
248
|
+
mongooseRegistry.add(schema, merged);
|
|
249
|
+
callHookSync('registry:added', { schema, meta: merged });
|
|
250
|
+
return schema;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Recursively unwrap Zod schemas (Optional, Nullable, Default, Effects, Pipelines)
|
|
255
|
+
* using Zod's public API and internal _def.type identifiers.
|
|
256
|
+
*/
|
|
257
|
+
function unwrapZodSchema(schema,
|
|
258
|
+
// eslint-disable-next-line unicorn/no-object-as-default-parameter
|
|
259
|
+
features = { required: true }, visited = new Set()) {
|
|
260
|
+
if (!schema)
|
|
261
|
+
return { schema, features };
|
|
262
|
+
if (visited.has(schema))
|
|
263
|
+
return { schema, features };
|
|
264
|
+
const def = schema._def;
|
|
265
|
+
if (!def)
|
|
266
|
+
return { schema, features };
|
|
267
|
+
// Skip visited check for wrappers to allow deep unwrapping
|
|
268
|
+
if (!(schema instanceof v4.z.ZodOptional) &&
|
|
269
|
+
!(schema instanceof v4.z.ZodNullable) &&
|
|
270
|
+
!(schema instanceof v4.z.ZodDefault) &&
|
|
271
|
+
def.type !== 'pipe') {
|
|
272
|
+
visited.add(schema);
|
|
273
|
+
}
|
|
274
|
+
if (schema instanceof v4.z.ZodOptional) {
|
|
275
|
+
const inner = schema.unwrap();
|
|
276
|
+
return unwrapZodSchema(
|
|
277
|
+
// @ts-expect-error Zod v4 schema.unwrap() return type mismatch
|
|
278
|
+
inner, {
|
|
279
|
+
...features,
|
|
280
|
+
required: false,
|
|
281
|
+
isOptional: true,
|
|
282
|
+
}, visited);
|
|
283
|
+
}
|
|
284
|
+
if (schema instanceof v4.z.ZodNullable) {
|
|
285
|
+
return unwrapZodSchema(
|
|
286
|
+
// @ts-expect-error Zod v4 schema.unwrap() return type mismatch
|
|
287
|
+
schema.unwrap(), {
|
|
288
|
+
...features,
|
|
289
|
+
isNullable: true,
|
|
290
|
+
}, visited);
|
|
291
|
+
}
|
|
292
|
+
if (schema instanceof v4.z.ZodDefault) {
|
|
293
|
+
const defaultValue = typeof def.defaultValue === 'function' ? def.defaultValue() : def.defaultValue;
|
|
294
|
+
return unwrapZodSchema(def.innerType, {
|
|
295
|
+
...features,
|
|
296
|
+
default: defaultValue,
|
|
297
|
+
}, visited);
|
|
298
|
+
}
|
|
299
|
+
const { type } = def;
|
|
300
|
+
// In Zod v4, transform, preprocess, and refine are often implemented as pipes.
|
|
301
|
+
// For transform: in = schema, out = transformation
|
|
302
|
+
// For preprocess: in = preprocessing, out = schema
|
|
303
|
+
if (type === 'pipe') {
|
|
304
|
+
const inType = def.in?._def?.type;
|
|
305
|
+
const outType = def.out?._def?.type;
|
|
306
|
+
if (inType === 'transform') {
|
|
307
|
+
// It's a preprocess (in is transformation, out is schema)
|
|
308
|
+
return unwrapZodSchema(def.out, features, visited);
|
|
309
|
+
}
|
|
310
|
+
if (outType === 'transform' || outType === 'refinement') {
|
|
311
|
+
// It's a transform or refine (in is schema, out is logic)
|
|
312
|
+
return unwrapZodSchema(def.in, features, visited);
|
|
313
|
+
}
|
|
314
|
+
// Default pipe behavior (extract the input part)
|
|
315
|
+
return unwrapZodSchema(def.in, features, visited);
|
|
316
|
+
}
|
|
317
|
+
if (type === 'transform' ||
|
|
318
|
+
type === 'preprocess' ||
|
|
319
|
+
type === 'refinement' ||
|
|
320
|
+
type === 'effects') {
|
|
321
|
+
const inner = def.schema || def.innerType;
|
|
322
|
+
if (inner) {
|
|
323
|
+
const result = unwrapZodSchema(inner, features, visited);
|
|
324
|
+
// Ensure we check registry for intermediate schemas if needed,
|
|
325
|
+
// but the registry check is now in extractMongooseDef.
|
|
326
|
+
return result;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
if (type === 'lazy') {
|
|
330
|
+
// For lazy types, we need to be careful with infinite recursion.
|
|
331
|
+
// If we've already seen this specific lazy schema in this unwrapping chain,
|
|
332
|
+
// we return it as is to stop recursion.
|
|
333
|
+
// NOTE: In Zod v4, getter() might return different objects each time if not careful.
|
|
334
|
+
return { schema, features };
|
|
335
|
+
}
|
|
336
|
+
if (type === 'branded' || type === 'readonly') {
|
|
337
|
+
return unwrapZodSchema(schema.unwrap(), {
|
|
338
|
+
...features,
|
|
339
|
+
...(type === 'readonly' ? { readOnly: true } : {}),
|
|
340
|
+
}, visited);
|
|
341
|
+
}
|
|
342
|
+
// Extract checks if present
|
|
343
|
+
if (def.checks && Array.isArray(def.checks)) {
|
|
344
|
+
features.checks = [...(features.checks || []), ...def.checks];
|
|
345
|
+
}
|
|
346
|
+
return { schema, features };
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
// Helper to get mongoose instance safely
|
|
350
|
+
const getMongoose = () => {
|
|
351
|
+
try {
|
|
352
|
+
// eslint-disable-next-line global-require
|
|
353
|
+
const m = require('mongoose');
|
|
354
|
+
if (m && (m.Schema || m.default?.Schema)) {
|
|
355
|
+
return m.default || m;
|
|
356
|
+
}
|
|
357
|
+
return m;
|
|
358
|
+
}
|
|
359
|
+
catch {
|
|
360
|
+
// Try to see if mongoose is globally available (e.g. in some environments)
|
|
361
|
+
if (globalThis.mongoose) {
|
|
362
|
+
return globalThis.mongoose;
|
|
363
|
+
}
|
|
364
|
+
return null;
|
|
365
|
+
}
|
|
366
|
+
};
|
|
367
|
+
let isFrontend = false;
|
|
368
|
+
/**
|
|
369
|
+
* Enable or disable frontend mode.
|
|
370
|
+
* In frontend mode, specialized types like ObjectId and Buffer fall back to
|
|
371
|
+
* simpler representations (strings/arrays) and do not depend on Mongoose.
|
|
372
|
+
*/
|
|
373
|
+
const setFrontendMode = (enabled) => {
|
|
374
|
+
isFrontend = enabled;
|
|
375
|
+
};
|
|
376
|
+
const getFrontendMode = () => {
|
|
377
|
+
// Try to auto-detect if not explicitly set
|
|
378
|
+
// This is a simple heuristic: check for window/document
|
|
379
|
+
if (isFrontend === undefined || isFrontend === null) {
|
|
380
|
+
return globalThis.window !== undefined && globalThis.document !== undefined;
|
|
381
|
+
}
|
|
382
|
+
return isFrontend;
|
|
383
|
+
};
|
|
384
|
+
|
|
385
|
+
/**
|
|
386
|
+
* Helper to map Zod checks (min, max, regex, etc.) to Mongoose Schema properties.
|
|
387
|
+
*/
|
|
388
|
+
function mapZodChecksToMongoose(checks, mongooseProp) {
|
|
389
|
+
if (!checks || !Array.isArray(checks))
|
|
390
|
+
return;
|
|
391
|
+
for (const check of checks) {
|
|
392
|
+
const traitSet = check._zod?.traits;
|
|
393
|
+
const checkDef = check._zod?.def;
|
|
394
|
+
if (!traitSet || !checkDef)
|
|
395
|
+
continue;
|
|
396
|
+
// String Lengths
|
|
397
|
+
if (traitSet.has('$ZodCheckMinLength')) {
|
|
398
|
+
mongooseProp.minlength = checkDef.minimum;
|
|
399
|
+
}
|
|
400
|
+
if (traitSet.has('$ZodCheckMaxLength')) {
|
|
401
|
+
mongooseProp.maxlength = checkDef.maximum;
|
|
402
|
+
}
|
|
403
|
+
if (traitSet.has('$ZodCheckLengthEquals')) {
|
|
404
|
+
mongooseProp.minlength = checkDef.length;
|
|
405
|
+
mongooseProp.maxlength = checkDef.length;
|
|
406
|
+
}
|
|
407
|
+
// Numbers and Dates Comparisons
|
|
408
|
+
if (traitSet.has('$ZodCheckGreaterThan')) {
|
|
409
|
+
mongooseProp.min = checkDef.value;
|
|
410
|
+
}
|
|
411
|
+
if (traitSet.has('$ZodCheckLessThan')) {
|
|
412
|
+
mongooseProp.max = checkDef.value;
|
|
413
|
+
}
|
|
414
|
+
// Regex / Match
|
|
415
|
+
if (traitSet.has('$ZodCheckRegex')) {
|
|
416
|
+
mongooseProp.match = checkDef.pattern;
|
|
417
|
+
}
|
|
418
|
+
// UUID
|
|
419
|
+
if (traitSet.has('$ZodUUID')) {
|
|
420
|
+
const mongoose = globalThis.mongoose || globalThis.__mongoose;
|
|
421
|
+
if (mongoose?.Schema.Types.UUID) {
|
|
422
|
+
mongooseProp.type = mongoose.Schema.Types.UUID;
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
// ISO Formats
|
|
426
|
+
if (traitSet.has('$ZodISODateTime') || traitSet.has('$ZodISODate')) {
|
|
427
|
+
mongooseProp.type = Date;
|
|
428
|
+
}
|
|
429
|
+
// String Transforms (trim, lowercase, uppercase)
|
|
430
|
+
if (traitSet.has('$ZodCheckOverwrite') && typeof checkDef.tx === 'function') {
|
|
431
|
+
const txStr = checkDef.tx.toString();
|
|
432
|
+
if (txStr.includes('.trim()')) {
|
|
433
|
+
mongooseProp.trim = true;
|
|
434
|
+
}
|
|
435
|
+
else if (txStr.includes('.toLowerCase()')) {
|
|
436
|
+
mongooseProp.lowercase = true;
|
|
437
|
+
}
|
|
438
|
+
else if (txStr.includes('.toUpperCase()')) {
|
|
439
|
+
mongooseProp.uppercase = true;
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
callHookSync('validation:mappers', { checks, mongooseProp });
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
/**
|
|
447
|
+
* Handles ZodObject conversion to Mongoose Schema definition.
|
|
448
|
+
*/
|
|
449
|
+
function handleObject(unwrapped, mongooseProp, visited, extractMongooseDef) {
|
|
450
|
+
callHookSync('schema:object:before', { schema: unwrapped, mongooseProp, visited });
|
|
451
|
+
const { shape } = unwrapped;
|
|
452
|
+
const objDef = {};
|
|
453
|
+
// We must ensure recursive calls see the current object to break cycles.
|
|
454
|
+
const placeholder = mongooseProp.type ? mongooseProp : objDef;
|
|
455
|
+
visited.set(unwrapped, placeholder);
|
|
456
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
457
|
+
for (const key in shape) {
|
|
458
|
+
if (!Object.prototype.hasOwnProperty.call(shape, key))
|
|
459
|
+
continue;
|
|
460
|
+
// Skip automatic _id mapping unless explicitly requested
|
|
461
|
+
if (key === '_id') {
|
|
462
|
+
const idMeta = mongooseRegistry.get(shape[key]) || {};
|
|
463
|
+
const unwrappedId = unwrapZodSchema(shape[key]).schema;
|
|
464
|
+
const unwrappedIdMeta = mongooseRegistry.get(unwrappedId) || {};
|
|
465
|
+
if (idMeta.includeId !== true &&
|
|
466
|
+
unwrappedIdMeta.includeId !== true &&
|
|
467
|
+
mongooseProp.includeId !== true) {
|
|
468
|
+
continue;
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
const def = extractMongooseDef(shape[key], visited);
|
|
472
|
+
if (def && typeof def === 'object' && def.__isDiscriminatorUnion) {
|
|
473
|
+
const mongoose = getMongoose();
|
|
474
|
+
if (mongoose) {
|
|
475
|
+
const baseSchema = new mongoose.Schema(def.baseDef, {
|
|
476
|
+
discriminatorKey: def.discriminatorKey,
|
|
477
|
+
_id: false,
|
|
478
|
+
});
|
|
479
|
+
const discriminators = {};
|
|
480
|
+
for (const [dKey, dDef] of Object.entries(def.discriminators)) {
|
|
481
|
+
discriminators[dKey] = new mongoose.Schema(dDef, { _id: false });
|
|
482
|
+
}
|
|
483
|
+
objDef[key] = {
|
|
484
|
+
type: baseSchema,
|
|
485
|
+
discriminators,
|
|
486
|
+
};
|
|
487
|
+
}
|
|
488
|
+
else {
|
|
489
|
+
objDef[key] = def;
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
else if (typeof def === 'object' && def !== null && !Array.isArray(def)) {
|
|
493
|
+
const { includeId, ...cleanDef } = def;
|
|
494
|
+
objDef[key] = cleanDef;
|
|
495
|
+
}
|
|
496
|
+
else {
|
|
497
|
+
objDef[key] = def;
|
|
498
|
+
}
|
|
499
|
+
callHookSync('schema:object:field', { key, schema: shape[key], objDef, visited });
|
|
500
|
+
}
|
|
501
|
+
// If the developer didn't provide a strict Mongoose type override, return the shape
|
|
502
|
+
let result;
|
|
503
|
+
if (mongooseProp.type) {
|
|
504
|
+
// If there is a type override, merge the object definition into the result
|
|
505
|
+
Object.assign(mongooseProp, objDef);
|
|
506
|
+
result = mongooseProp;
|
|
507
|
+
}
|
|
508
|
+
else {
|
|
509
|
+
Object.assign(mongooseProp, objDef);
|
|
510
|
+
const topLevelOptions = new Set([
|
|
511
|
+
'collection',
|
|
512
|
+
'versionKey',
|
|
513
|
+
'timestamps',
|
|
514
|
+
'discriminatorKey',
|
|
515
|
+
'strict',
|
|
516
|
+
'id',
|
|
517
|
+
'_id',
|
|
518
|
+
'minimize',
|
|
519
|
+
'validateBeforeSave',
|
|
520
|
+
]);
|
|
521
|
+
const hasFieldMetadata = Object.keys(mongooseProp).some((k) => {
|
|
522
|
+
if (Object.prototype.hasOwnProperty.call(objDef, k))
|
|
523
|
+
return false;
|
|
524
|
+
if (topLevelOptions.has(k))
|
|
525
|
+
return false;
|
|
526
|
+
if (k === 'required' && mongooseProp[k] === false)
|
|
527
|
+
return false;
|
|
528
|
+
return true;
|
|
529
|
+
});
|
|
530
|
+
result = hasFieldMetadata ? mongooseProp : objDef;
|
|
531
|
+
}
|
|
532
|
+
callHookSync('schema:object:after', { schema: unwrapped, mongooseProp, objDef, result });
|
|
533
|
+
return result;
|
|
534
|
+
}
|
|
535
|
+
/**
|
|
536
|
+
* Handles ZodArray, ZodSet, and ZodTuple conversion.
|
|
537
|
+
*/
|
|
538
|
+
function handleArray(unwrapped, mongooseProp, visited, extractMongooseDef) {
|
|
539
|
+
callHookSync('schema:array:before', { schema: unwrapped, mongooseProp, visited });
|
|
540
|
+
const element = unwrapped.element ||
|
|
541
|
+
unwrapped._def.valueType ||
|
|
542
|
+
unwrapped._def.rest ||
|
|
543
|
+
unwrapped._def.items?.[0];
|
|
544
|
+
const mongoose = getMongoose();
|
|
545
|
+
const innerDef = element
|
|
546
|
+
? extractMongooseDef(element, visited)
|
|
547
|
+
: mongoose?.Schema.Types.Mixed || 'Mixed';
|
|
548
|
+
// If no explicit type override, wrap the inner definition in an array
|
|
549
|
+
if (!mongooseProp.type) {
|
|
550
|
+
if (innerDef && typeof innerDef === 'object' && innerDef.__isDiscriminatorUnion && mongoose) {
|
|
551
|
+
// const baseSchema =
|
|
552
|
+
// new mongoose.Schema(innerDef.baseDef, {
|
|
553
|
+
// discriminatorKey: innerDef.discriminatorKey,
|
|
554
|
+
// _id: false,
|
|
555
|
+
// });
|
|
556
|
+
const discriminators = {};
|
|
557
|
+
for (const [dKey, dDef] of Object.entries(innerDef.discriminators)) {
|
|
558
|
+
discriminators[dKey] = new mongoose.Schema(dDef, { _id: false });
|
|
559
|
+
}
|
|
560
|
+
mongooseProp.type = [
|
|
561
|
+
new mongoose.Schema({}, {
|
|
562
|
+
discriminatorKey: innerDef.discriminatorKey,
|
|
563
|
+
_id: false,
|
|
564
|
+
}),
|
|
565
|
+
];
|
|
566
|
+
mongooseProp.discriminators = discriminators;
|
|
567
|
+
}
|
|
568
|
+
else {
|
|
569
|
+
const innerType = innerDef.type || innerDef;
|
|
570
|
+
mongooseProp.type = [innerType];
|
|
571
|
+
// Transfer any metadata from the inner type (like 'ref') to the array definition
|
|
572
|
+
if (typeof innerDef === 'object') {
|
|
573
|
+
// eslint-disable-next-line sonarjs/no-unused-vars
|
|
574
|
+
const { type: _extractedType, ...innerMeta } = innerDef;
|
|
575
|
+
Object.assign(mongooseProp, innerMeta);
|
|
576
|
+
mongooseProp.type = [innerType]; // Restore type as array
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
callHookSync('schema:array:after', { schema: unwrapped, mongooseProp, innerDef });
|
|
581
|
+
}
|
|
582
|
+
/**
|
|
583
|
+
* Handles ZodRecord and ZodMap conversion.
|
|
584
|
+
*/
|
|
585
|
+
function handleRecord(unwrapped, mongooseProp, visited, extractMongooseDef) {
|
|
586
|
+
callHookSync('schema:record:before', { schema: unwrapped, mongooseProp, visited });
|
|
587
|
+
const valueType = unwrapped.valueType ||
|
|
588
|
+
unwrapped.valueSchema ||
|
|
589
|
+
unwrapped._def.valueType ||
|
|
590
|
+
unwrapped._def.valueSchema ||
|
|
591
|
+
unwrapped._def.innerType; // For some Zod versions
|
|
592
|
+
let innerDef;
|
|
593
|
+
if (!mongooseProp.type || mongooseProp.type === Map) {
|
|
594
|
+
mongooseProp.type = Map;
|
|
595
|
+
const finalValueType = valueType || unwrapped.valueSchema || unwrapped._def?.valueSchema;
|
|
596
|
+
if (finalValueType) {
|
|
597
|
+
innerDef = extractMongooseDef(finalValueType, visited);
|
|
598
|
+
mongooseProp.of = innerDef.type || innerDef;
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
callHookSync('schema:record:after', { schema: unwrapped, mongooseProp, innerDef });
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
/**
|
|
605
|
+
* THE CONVERTER (Safe AST Walker)
|
|
606
|
+
* We extract the Zod type and merge it with any registered Mongoose metadata.
|
|
607
|
+
*/
|
|
608
|
+
function extractMongooseDef(schema, visited = new Map(), isField = false) {
|
|
609
|
+
// Only call converter:before at the very beginning of a run
|
|
610
|
+
if (visited.size === 0) {
|
|
611
|
+
callHookSync('converter:before', { schema: schema, visited });
|
|
612
|
+
}
|
|
613
|
+
callHookSync('converter:start', { schema: schema, visited });
|
|
614
|
+
const { schema: unwrapped, features } = unwrapZodSchema(schema);
|
|
615
|
+
// Pull any explicitly registered Mongoose metadata
|
|
616
|
+
callHookSync('registry:get:before', { schema: schema });
|
|
617
|
+
const meta = mongooseRegistry.get(schema) || {};
|
|
618
|
+
callHookSync('registry:get', { schema: schema, meta });
|
|
619
|
+
callHookSync('registry:get:before', { schema: unwrapped });
|
|
620
|
+
const unwrappedMeta = mongooseRegistry.get(unwrapped) || {};
|
|
621
|
+
callHookSync('registry:get', { schema: unwrapped, meta: unwrappedMeta });
|
|
622
|
+
// If we have a chain of wrappers, collect metadata from all of them.
|
|
623
|
+
let currentMeta = { ...unwrappedMeta, ...meta };
|
|
624
|
+
if (schema._def.innerType) {
|
|
625
|
+
let inner = schema._def.innerType;
|
|
626
|
+
while (inner) {
|
|
627
|
+
callHookSync('registry:get:before', { schema: inner });
|
|
628
|
+
const innerMeta = mongooseRegistry.get(inner);
|
|
629
|
+
callHookSync('registry:get', { schema: inner, meta: innerMeta });
|
|
630
|
+
if (innerMeta) {
|
|
631
|
+
currentMeta = { ...innerMeta, ...currentMeta };
|
|
632
|
+
}
|
|
633
|
+
inner = inner._def?.innerType || inner._def?.schema;
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
const mongooseProp = currentMeta;
|
|
637
|
+
callHookSync('converter:unwrapped', {
|
|
638
|
+
schema: schema,
|
|
639
|
+
unwrapped,
|
|
640
|
+
features,
|
|
641
|
+
meta: currentMeta,
|
|
642
|
+
mongooseProp: mongooseProp,
|
|
643
|
+
});
|
|
644
|
+
if (features.isOptional === true && mongooseProp.type && mongooseProp.required !== true) {
|
|
645
|
+
mongooseProp.required = false;
|
|
646
|
+
}
|
|
647
|
+
if (visited.has(unwrapped)) {
|
|
648
|
+
const existing = visited.get(unwrapped);
|
|
649
|
+
if (existing === mongooseProp) {
|
|
650
|
+
return existing;
|
|
651
|
+
}
|
|
652
|
+
// console.log('Visited CACHE for', (unwrapped as any)._def.type, existing);
|
|
653
|
+
if (Object.keys(meta).length > 0) {
|
|
654
|
+
Object.assign(existing, mongooseProp);
|
|
655
|
+
}
|
|
656
|
+
return existing;
|
|
657
|
+
}
|
|
658
|
+
visited.set(unwrapped, mongooseProp);
|
|
659
|
+
// console.log('Visited set for', (unwrapped as any)._def.type, mongooseProp);
|
|
660
|
+
if (features.default !== undefined) {
|
|
661
|
+
mongooseProp.default = features.default;
|
|
662
|
+
}
|
|
663
|
+
if (features.required === false) {
|
|
664
|
+
mongooseProp.required = false;
|
|
665
|
+
}
|
|
666
|
+
if (features.readOnly === true) {
|
|
667
|
+
mongooseProp.readOnly = true;
|
|
668
|
+
}
|
|
669
|
+
// Map Zod checks to Mongoose options
|
|
670
|
+
mapZodChecksToMongoose(features.checks, mongooseProp);
|
|
671
|
+
const def = unwrapped._def;
|
|
672
|
+
if (!def) {
|
|
673
|
+
callHookSync('converter:after', {
|
|
674
|
+
schema: schema,
|
|
675
|
+
mongooseProp,
|
|
676
|
+
});
|
|
677
|
+
return mongooseProp;
|
|
678
|
+
}
|
|
679
|
+
const { type } = def;
|
|
680
|
+
callHookSync('converter:node', {
|
|
681
|
+
schema: unwrapped,
|
|
682
|
+
mongooseProp,
|
|
683
|
+
type,
|
|
684
|
+
});
|
|
685
|
+
// Handle recursion and specific types via separate handlers
|
|
686
|
+
if (type === 'object') {
|
|
687
|
+
const wrapperFn = (s, v) => extractMongooseDef(s, v, true);
|
|
688
|
+
const result = handleObject(unwrapped, mongooseProp, visited, wrapperFn);
|
|
689
|
+
callHookSync('converter:after', {
|
|
690
|
+
schema: schema,
|
|
691
|
+
mongooseProp: result,
|
|
692
|
+
});
|
|
693
|
+
if (typeof result === 'object' && result !== null && !Array.isArray(result)) {
|
|
694
|
+
delete result.includeId;
|
|
695
|
+
}
|
|
696
|
+
return result;
|
|
697
|
+
}
|
|
698
|
+
if (type === 'array' || type === 'set' || type === 'tuple') {
|
|
699
|
+
handleArray(unwrapped, mongooseProp, visited, (s, v) => extractMongooseDef(s, v, true));
|
|
700
|
+
}
|
|
701
|
+
if (type === 'record' || type === 'map') {
|
|
702
|
+
handleRecord(unwrapped, mongooseProp, visited, (s, v) => extractMongooseDef(s, v, true));
|
|
703
|
+
}
|
|
704
|
+
// Handle Intersections
|
|
705
|
+
if (type === 'intersection') {
|
|
706
|
+
const left = extractMongooseDef(unwrapped._def.left, visited, isField);
|
|
707
|
+
const right = extractMongooseDef(unwrapped._def.right, visited, isField);
|
|
708
|
+
if (typeof left === 'object' && typeof right === 'object') {
|
|
709
|
+
Object.assign(mongooseProp, left, right);
|
|
710
|
+
}
|
|
711
|
+
else if (!mongooseProp.type) {
|
|
712
|
+
mongooseProp.type = getMongoose()?.Schema.Types.Mixed || 'Mixed';
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
if ((type === 'union' ||
|
|
716
|
+
type === 'discriminatedunion' ||
|
|
717
|
+
type === 'discriminated_union' ||
|
|
718
|
+
type === 'xor') &&
|
|
719
|
+
!mongooseProp.type) {
|
|
720
|
+
const mongoose = getMongoose();
|
|
721
|
+
const options = unwrapped.options || unwrapped._def.options;
|
|
722
|
+
const discriminatorKey = unwrapped._def.discriminator;
|
|
723
|
+
const unionCtx = {
|
|
724
|
+
isSimpleUnion: false,
|
|
725
|
+
isObjectUnion: false,
|
|
726
|
+
isXor: type === 'xor' ||
|
|
727
|
+
((unwrapped._def?.inclusive === false ||
|
|
728
|
+
schema._def?.inclusive === false) &&
|
|
729
|
+
!discriminatorKey &&
|
|
730
|
+
!schema._def?.discriminator),
|
|
731
|
+
};
|
|
732
|
+
if (Array.isArray(options) && options.length > 0) {
|
|
733
|
+
unionCtx.isSimpleUnion = options.every((opt) => {
|
|
734
|
+
const { type } = unwrapZodSchema(opt).schema._def;
|
|
735
|
+
return ['string', 'number', 'boolean', 'date', 'bigint', 'literal'].includes(type);
|
|
736
|
+
});
|
|
737
|
+
unionCtx.isObjectUnion = options.every((opt) => {
|
|
738
|
+
const { type } = unwrapZodSchema(opt).schema._def;
|
|
739
|
+
return type === 'object';
|
|
740
|
+
});
|
|
741
|
+
}
|
|
742
|
+
callHookSync('schema:union:before', { schema: unwrapped, mongooseProp, ctx: unionCtx });
|
|
743
|
+
if (discriminatorKey && unionCtx.isObjectUnion) {
|
|
744
|
+
const discriminators = {};
|
|
745
|
+
const allOptionDefs = [];
|
|
746
|
+
for (const option of options) {
|
|
747
|
+
const { schema: unwrappedOpt } = unwrapZodSchema(option);
|
|
748
|
+
const { shape } = unwrappedOpt._def;
|
|
749
|
+
const discriminatorProp = shape[discriminatorKey];
|
|
750
|
+
// Support both ZodLiteral and ZodOptional/ZodDefault/ZodNullable wrapped literals
|
|
751
|
+
const { schema: unwrappedDisc } = unwrapZodSchema(discriminatorProp);
|
|
752
|
+
const discriminatorValue = unwrappedDisc._def.value ?? unwrappedDisc._def.values?.[0];
|
|
753
|
+
// Use a fresh Map for each option to avoid cross-contamination of visited nodes
|
|
754
|
+
const optionDef = extractMongooseDef(option, new Map(), true);
|
|
755
|
+
if (optionDef && typeof optionDef === 'object' && !Array.isArray(optionDef)) {
|
|
756
|
+
const cleanOptionDef = { ...optionDef };
|
|
757
|
+
delete cleanOptionDef[discriminatorKey];
|
|
758
|
+
discriminators[discriminatorValue] = cleanOptionDef;
|
|
759
|
+
allOptionDefs.push(cleanOptionDef);
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
// Identify common fields present in ALL options to move to baseDef
|
|
763
|
+
const baseDef = {};
|
|
764
|
+
if (allOptionDefs.length > 0) {
|
|
765
|
+
const firstOption = allOptionDefs[0];
|
|
766
|
+
for (const key of Object.keys(firstOption)) {
|
|
767
|
+
const isCommon = allOptionDefs.every((def) => {
|
|
768
|
+
if (!(key in def))
|
|
769
|
+
return false;
|
|
770
|
+
// Simple check for equality of definitions (can be improved)
|
|
771
|
+
return JSON.stringify(def[key]) === JSON.stringify(firstOption[key]);
|
|
772
|
+
});
|
|
773
|
+
if (isCommon) {
|
|
774
|
+
baseDef[key] = firstOption[key];
|
|
775
|
+
// Remove from discriminators to avoid duplication
|
|
776
|
+
for (const def of allOptionDefs) {
|
|
777
|
+
delete def[key];
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
const result = {
|
|
783
|
+
__isDiscriminatorUnion: true,
|
|
784
|
+
discriminatorKey,
|
|
785
|
+
discriminators,
|
|
786
|
+
baseDef,
|
|
787
|
+
validate: {
|
|
788
|
+
validator(_v) {
|
|
789
|
+
try {
|
|
790
|
+
// Ensure we include the discriminator key in the object being validated
|
|
791
|
+
const mongoose = getMongoose();
|
|
792
|
+
const doc = mongoose && this instanceof mongoose.Document ? this.toObject() : this || {};
|
|
793
|
+
schema.parse(doc);
|
|
794
|
+
return true;
|
|
795
|
+
}
|
|
796
|
+
catch (err) {
|
|
797
|
+
const message = err?.errors?.[0]?.message || err.message;
|
|
798
|
+
if (this && typeof this.invalidate === 'function') {
|
|
799
|
+
this.invalidate(discriminatorKey, `Zod validation failed: ${message}`);
|
|
800
|
+
}
|
|
801
|
+
return false;
|
|
802
|
+
}
|
|
803
|
+
},
|
|
804
|
+
message: (props) => `Validation failed for ${props.path}`,
|
|
805
|
+
},
|
|
806
|
+
};
|
|
807
|
+
// If this is wrapped in a meta object, ensure we return the result properly
|
|
808
|
+
if (mongooseProp && typeof mongooseProp === 'object' && !Array.isArray(mongooseProp)) {
|
|
809
|
+
Object.assign(mongooseProp, result);
|
|
810
|
+
callHookSync('schema:union:after', {
|
|
811
|
+
schema: unwrapped,
|
|
812
|
+
mongooseProp,
|
|
813
|
+
ctx: unionCtx,
|
|
814
|
+
});
|
|
815
|
+
return mongooseProp;
|
|
816
|
+
}
|
|
817
|
+
callHookSync('schema:union:after', {
|
|
818
|
+
schema: unwrapped,
|
|
819
|
+
mongooseProp: result,
|
|
820
|
+
ctx: unionCtx,
|
|
821
|
+
});
|
|
822
|
+
return result;
|
|
823
|
+
}
|
|
824
|
+
if (getMongoose()?.Schema.Types.Union &&
|
|
825
|
+
unionCtx.isSimpleUnion &&
|
|
826
|
+
options.length > 0 &&
|
|
827
|
+
!unionCtx.isXor) {
|
|
828
|
+
mongooseProp.type = mongoose.Schema.Types.Union;
|
|
829
|
+
mongooseProp.of = options.map((opt) => {
|
|
830
|
+
const def = extractMongooseDef(opt, visited, true);
|
|
831
|
+
return def.type || def;
|
|
832
|
+
});
|
|
833
|
+
}
|
|
834
|
+
else if (unionCtx.isObjectUnion && options.length > 0) {
|
|
835
|
+
// Merge all object properties into a single schema object
|
|
836
|
+
const mergedDef = {};
|
|
837
|
+
for (const opt of options) {
|
|
838
|
+
const def = extractMongooseDef(opt, new Map(), true);
|
|
839
|
+
if (typeof def === 'object' && def !== null) {
|
|
840
|
+
for (const [key, prop] of Object.entries(def)) {
|
|
841
|
+
if (typeof prop === 'object' && prop !== null && !Array.isArray(prop)) {
|
|
842
|
+
prop.required = false;
|
|
843
|
+
}
|
|
844
|
+
if (mergedDef[key] &&
|
|
845
|
+
typeof mergedDef[key] === 'object' &&
|
|
846
|
+
typeof prop === 'object' &&
|
|
847
|
+
!Array.isArray(mergedDef[key]) &&
|
|
848
|
+
!Array.isArray(prop)) {
|
|
849
|
+
const existingType = mergedDef[key].type ||
|
|
850
|
+
mergedDef[key].instance ||
|
|
851
|
+
(typeof mergedDef[key] === 'function' ? mergedDef[key] : null);
|
|
852
|
+
const newType = prop.type ||
|
|
853
|
+
prop.instance ||
|
|
854
|
+
(typeof prop === 'function' ? prop : null);
|
|
855
|
+
const isMixed = (t) => !t ||
|
|
856
|
+
t === 'Mixed' ||
|
|
857
|
+
t === 'SchemaMixed' ||
|
|
858
|
+
t?.name === 'Mixed' ||
|
|
859
|
+
t?.instance === 'Mixed' ||
|
|
860
|
+
t?.name === 'SchemaMixed' ||
|
|
861
|
+
t?.instance === 'SchemaMixed' ||
|
|
862
|
+
(getMongoose()?.Schema.Types.Mixed &&
|
|
863
|
+
(t === getMongoose()?.Schema.Types.Mixed ||
|
|
864
|
+
t?.instance === 'Mixed' ||
|
|
865
|
+
t?.instance === 'SchemaMixed'));
|
|
866
|
+
if (isMixed(existingType) && !isMixed(newType)) {
|
|
867
|
+
mergedDef[key] = prop;
|
|
868
|
+
}
|
|
869
|
+
else if (!isMixed(existingType) && isMixed(newType)) ;
|
|
870
|
+
else {
|
|
871
|
+
Object.assign(mergedDef[key], prop);
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
else if (!mergedDef[key] ||
|
|
875
|
+
typeof mergedDef[key] !== 'object' ||
|
|
876
|
+
Array.isArray(mergedDef[key])) {
|
|
877
|
+
mergedDef[key] = prop;
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
if (isField && unionCtx.isXor) {
|
|
883
|
+
// For nested XOR, always use Mixed with validator to ensure mutual exclusivity
|
|
884
|
+
mongooseProp.type = mongoose?.Schema.Types.Mixed || 'Mixed';
|
|
885
|
+
mongooseProp.validate = {
|
|
886
|
+
validator(v) {
|
|
887
|
+
try {
|
|
888
|
+
schema.parse(v);
|
|
889
|
+
return true;
|
|
890
|
+
}
|
|
891
|
+
catch {
|
|
892
|
+
return false;
|
|
893
|
+
}
|
|
894
|
+
},
|
|
895
|
+
message: 'XOR validation failed',
|
|
896
|
+
};
|
|
897
|
+
}
|
|
898
|
+
else {
|
|
899
|
+
// For root or other object unions, merge properties
|
|
900
|
+
if (!mongooseProp.type ||
|
|
901
|
+
mongooseProp.type === (getMongoose()?.Schema.Types.Mixed || 'Mixed')) {
|
|
902
|
+
delete mongooseProp.type;
|
|
903
|
+
}
|
|
904
|
+
Object.assign(mongooseProp, mergedDef);
|
|
905
|
+
// If the object contains a 'type' property, Mongoose might misinterpret it as a field definition.
|
|
906
|
+
// We can hint that it's a nested object by using a Schema if 'type' is present along with other fields.
|
|
907
|
+
if (isField &&
|
|
908
|
+
Object.prototype.hasOwnProperty.call(mongooseProp, 'type') &&
|
|
909
|
+
Object.keys(mongooseProp).length > 1) {
|
|
910
|
+
const mongooseInstance = getMongoose();
|
|
911
|
+
if (mongooseInstance) {
|
|
912
|
+
mongooseProp.type = new mongooseInstance.Schema(mongooseProp, { _id: false });
|
|
913
|
+
for (const key of Object.keys(mongooseProp)) {
|
|
914
|
+
if (key !== 'type')
|
|
915
|
+
delete mongooseProp[key];
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
}
|
|
921
|
+
else {
|
|
922
|
+
mongooseProp.type = mongoose?.Schema.Types.Mixed || 'Mixed';
|
|
923
|
+
if (isField &&
|
|
924
|
+
(type === 'xor' ||
|
|
925
|
+
type === 'discriminated_union' ||
|
|
926
|
+
type === 'discriminatedunion' ||
|
|
927
|
+
type === 'union') &&
|
|
928
|
+
!mongooseProp.ref && // Skip Zod validation for populated fields
|
|
929
|
+
!Array.isArray(mongooseProp.type) && // Skip Zod validation for arrays
|
|
930
|
+
mongooseProp.type !== Map && // Skip Zod validation for maps
|
|
931
|
+
!mongooseProp.of // Skip Zod validation for collections
|
|
932
|
+
) {
|
|
933
|
+
mongooseProp.validate = {
|
|
934
|
+
validator(v) {
|
|
935
|
+
try {
|
|
936
|
+
schema.parse(v);
|
|
937
|
+
return true;
|
|
938
|
+
}
|
|
939
|
+
catch (err) {
|
|
940
|
+
return false;
|
|
941
|
+
}
|
|
942
|
+
},
|
|
943
|
+
message: (props) => {
|
|
944
|
+
if (unionCtx.isXor)
|
|
945
|
+
return 'XOR validation failed';
|
|
946
|
+
try {
|
|
947
|
+
schema.parse(props.value);
|
|
948
|
+
}
|
|
949
|
+
catch (err) {
|
|
950
|
+
return `Union validation failed: ${err.message}`;
|
|
951
|
+
}
|
|
952
|
+
return 'Union validation failed';
|
|
953
|
+
},
|
|
954
|
+
};
|
|
955
|
+
}
|
|
956
|
+
}
|
|
957
|
+
callHookSync('schema:union:after', {
|
|
958
|
+
schema: unwrapped,
|
|
959
|
+
mongooseProp,
|
|
960
|
+
ctx: unionCtx,
|
|
961
|
+
});
|
|
962
|
+
}
|
|
963
|
+
if (type === 'literal' && !mongooseProp.type) {
|
|
964
|
+
mongooseProp.type = getMongoose()?.Schema.Types.Mixed || 'Mixed';
|
|
965
|
+
}
|
|
966
|
+
// Handle Primitives
|
|
967
|
+
switch (type) {
|
|
968
|
+
case 'string':
|
|
969
|
+
case 'number':
|
|
970
|
+
case 'boolean':
|
|
971
|
+
case 'date':
|
|
972
|
+
case 'bigint': {
|
|
973
|
+
if (!mongooseProp.type) {
|
|
974
|
+
if (type === 'bigint') {
|
|
975
|
+
mongooseProp.type = typeof BigInt === 'undefined' ? Number : BigInt;
|
|
976
|
+
}
|
|
977
|
+
else {
|
|
978
|
+
const typeMap = {
|
|
979
|
+
string: String,
|
|
980
|
+
number: Number,
|
|
981
|
+
boolean: Boolean,
|
|
982
|
+
date: Date,
|
|
983
|
+
};
|
|
984
|
+
mongooseProp.type = typeMap[type];
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
if (mongooseProp.required !== false)
|
|
988
|
+
mongooseProp.required = true;
|
|
989
|
+
break;
|
|
990
|
+
}
|
|
991
|
+
case 'enum':
|
|
992
|
+
case 'nativeenum':
|
|
993
|
+
case 'native_enum': {
|
|
994
|
+
if (!mongooseProp.type)
|
|
995
|
+
mongooseProp.type = String;
|
|
996
|
+
mongooseProp.enum =
|
|
997
|
+
type === 'enum'
|
|
998
|
+
? unwrapped.options || def.values
|
|
999
|
+
: Object.values(unwrapped.enum || def.values);
|
|
1000
|
+
if (mongooseProp.required !== false)
|
|
1001
|
+
mongooseProp.required = true;
|
|
1002
|
+
break;
|
|
1003
|
+
}
|
|
1004
|
+
// Do nothing
|
|
1005
|
+
}
|
|
1006
|
+
// Handle Specialized Types (Buffer, ObjectId)
|
|
1007
|
+
const mongooseInstance = getMongoose();
|
|
1008
|
+
if (type === 'any' || type === 'unknown' || type === 'custom') {
|
|
1009
|
+
const cls = def.cls || unwrapped.cls;
|
|
1010
|
+
if (cls === Buffer || (typeof Uint8Array !== 'undefined' && cls === Uint8Array)) {
|
|
1011
|
+
if (!mongooseProp.type)
|
|
1012
|
+
mongooseProp.type = mongooseInstance?.Schema.Types.Buffer || 'Buffer';
|
|
1013
|
+
}
|
|
1014
|
+
else if ((cls?.name === 'ObjectId' || (mongooseInstance && cls === mongooseInstance.Types.ObjectId)) &&
|
|
1015
|
+
!mongooseProp.type) {
|
|
1016
|
+
mongooseProp.type = mongooseInstance?.Schema.Types.ObjectId || 'ObjectId';
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
// Handle Lazy (Recursion Support)
|
|
1020
|
+
if (type === 'lazy') {
|
|
1021
|
+
const inner = def.getter();
|
|
1022
|
+
const result = extractMongooseDef(inner, visited, isField);
|
|
1023
|
+
if (Object.keys(meta).length > 0 && result !== mongooseProp) {
|
|
1024
|
+
if (typeof result === 'object' && !Array.isArray(result)) {
|
|
1025
|
+
Object.assign(mongooseProp, result);
|
|
1026
|
+
}
|
|
1027
|
+
else {
|
|
1028
|
+
mongooseProp.type = result.type || result;
|
|
1029
|
+
}
|
|
1030
|
+
return mongooseProp;
|
|
1031
|
+
}
|
|
1032
|
+
return result;
|
|
1033
|
+
}
|
|
1034
|
+
// Fallback for z.any() or unhandled types
|
|
1035
|
+
if (!mongooseProp.type && type !== 'object') {
|
|
1036
|
+
mongooseProp.type = getMongoose()?.Schema.Types.Mixed || 'Mixed';
|
|
1037
|
+
}
|
|
1038
|
+
callHookSync('converter:after', {
|
|
1039
|
+
schema: schema,
|
|
1040
|
+
mongooseProp,
|
|
1041
|
+
});
|
|
1042
|
+
if (typeof mongooseProp === 'object' && mongooseProp !== null && !Array.isArray(mongooseProp)) {
|
|
1043
|
+
delete mongooseProp.includeId;
|
|
1044
|
+
}
|
|
1045
|
+
return mongooseProp;
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
/**
|
|
1049
|
+
* Converts a Zod schema to a Mongoose Schema instance.
|
|
1050
|
+
*/
|
|
1051
|
+
function toMongooseSchema(schema, options) {
|
|
1052
|
+
const { schema: unwrapped } = unwrapZodSchema(schema);
|
|
1053
|
+
const meta = mongooseRegistry.get(schema) ||
|
|
1054
|
+
mongooseRegistry.get(unwrapped) ||
|
|
1055
|
+
schema.meta?.() ||
|
|
1056
|
+
unwrapped.meta?.() ||
|
|
1057
|
+
{};
|
|
1058
|
+
const { plugins, ...schemaOptions } = options || {};
|
|
1059
|
+
const mergedOptions = {
|
|
1060
|
+
// Also merge other schema options from meta if they exist
|
|
1061
|
+
...(meta.collection ? { collection: meta.collection } : {}),
|
|
1062
|
+
// eslint-disable-next-line unicorn/no-negated-condition
|
|
1063
|
+
...(meta.strict !== undefined ? { strict: meta.strict } : {}),
|
|
1064
|
+
// eslint-disable-next-line unicorn/no-negated-condition
|
|
1065
|
+
...(meta.minimize !== undefined ? { minimize: meta.minimize } : {}),
|
|
1066
|
+
// eslint-disable-next-line unicorn/no-negated-condition
|
|
1067
|
+
...(meta.validateBeforeSave !== undefined ? { validateBeforeSave: meta.validateBeforeSave } : {}),
|
|
1068
|
+
// eslint-disable-next-line unicorn/no-negated-condition
|
|
1069
|
+
...(meta.versionKey !== undefined ? { versionKey: meta.versionKey } : {}),
|
|
1070
|
+
...(meta.id === undefined ? {} : { id: meta.id }),
|
|
1071
|
+
...(meta._id === undefined ? {} : { _id: meta._id }),
|
|
1072
|
+
...(meta.timestamps ? { timestamps: meta.timestamps } : {}),
|
|
1073
|
+
...(meta.discriminatorKey ? { discriminatorKey: meta.discriminatorKey } : {}),
|
|
1074
|
+
...schemaOptions,
|
|
1075
|
+
};
|
|
1076
|
+
let definition = extractMongooseDef(schema, new Map(), false);
|
|
1077
|
+
const mongoose = getMongoose();
|
|
1078
|
+
if (!mongoose) {
|
|
1079
|
+
throw new Error('Mongoose must be installed to use toMongooseSchema. If you are in an ESM environment, ensure mongoose is loaded.');
|
|
1080
|
+
}
|
|
1081
|
+
let mongooseSchema;
|
|
1082
|
+
if (definition && typeof definition === 'object' && definition.__isDiscriminatorUnion) {
|
|
1083
|
+
const { discriminatorKey, discriminators, baseDef, validate } = definition;
|
|
1084
|
+
mongooseSchema = new mongoose.Schema(baseDef, {
|
|
1085
|
+
...mergedOptions,
|
|
1086
|
+
discriminatorKey,
|
|
1087
|
+
});
|
|
1088
|
+
if (validate) {
|
|
1089
|
+
if (!mongooseSchema.path(discriminatorKey)) {
|
|
1090
|
+
mongooseSchema.add({ [discriminatorKey]: { type: String } });
|
|
1091
|
+
}
|
|
1092
|
+
mongooseSchema.path(discriminatorKey).validate(validate);
|
|
1093
|
+
}
|
|
1094
|
+
for (const [key, dDef] of Object.entries(discriminators)) {
|
|
1095
|
+
if (mongooseSchema.discriminators && mongooseSchema.discriminators[key]) {
|
|
1096
|
+
continue;
|
|
1097
|
+
}
|
|
1098
|
+
mongooseSchema.discriminator(key, new mongoose.Schema(dDef, { _id: false }));
|
|
1099
|
+
}
|
|
1100
|
+
}
|
|
1101
|
+
else {
|
|
1102
|
+
// Strip internal includeId metadata that might have leaked into the definition
|
|
1103
|
+
if (typeof definition === 'object' && definition !== null) {
|
|
1104
|
+
// If it's a top-level object, it might have metadata fields directly
|
|
1105
|
+
const { includeId, ...cleanDefinition } = definition;
|
|
1106
|
+
definition = cleanDefinition;
|
|
1107
|
+
// Also clean any top-level field definitions
|
|
1108
|
+
for (const value of Object.values(definition)) {
|
|
1109
|
+
if (value && typeof value === 'object' && !Array.isArray(value)) {
|
|
1110
|
+
delete value.includeId;
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
mongooseSchema = new mongoose.Schema(definition, mergedOptions);
|
|
1115
|
+
}
|
|
1116
|
+
// Apply plugins if provided in options
|
|
1117
|
+
if (plugins && Array.isArray(plugins)) {
|
|
1118
|
+
for (const plugin of plugins) {
|
|
1119
|
+
mongooseSchema.plugin(plugin);
|
|
1120
|
+
}
|
|
1121
|
+
}
|
|
1122
|
+
// Call schema:created hook
|
|
1123
|
+
callHookSync('schema:created', {
|
|
1124
|
+
schema,
|
|
1125
|
+
mongooseSchema,
|
|
1126
|
+
options: mergedOptions,
|
|
1127
|
+
});
|
|
1128
|
+
return mongooseSchema;
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
const zObjectId = (options) => {
|
|
1132
|
+
if (getFrontendMode()) {
|
|
1133
|
+
return withMongoose(v4.z.preprocess((val) => (val === null ? undefined : val), v4.z.string().regex(/^[\dA-Fa-f]{24}$/, 'Invalid ObjectId')), {
|
|
1134
|
+
type: 'ObjectId', // String representation for metadata
|
|
1135
|
+
...options,
|
|
1136
|
+
});
|
|
1137
|
+
}
|
|
1138
|
+
const mongoose = getMongoose();
|
|
1139
|
+
return withMongoose(v4.z.preprocess((val) => (val === null ? undefined : val), v4.z.custom((val) => (mongoose && val instanceof mongoose.Types.ObjectId) ||
|
|
1140
|
+
(typeof val === 'string' && /^[\dA-Fa-f]{24}$/.test(val)))), {
|
|
1141
|
+
type: mongoose?.Schema.Types.ObjectId || 'ObjectId',
|
|
1142
|
+
...options,
|
|
1143
|
+
});
|
|
1144
|
+
};
|
|
1145
|
+
const zBuffer = (options) => {
|
|
1146
|
+
if (getFrontendMode()) {
|
|
1147
|
+
return withMongoose(v4.z.instanceof(Uint8Array), {
|
|
1148
|
+
type: 'Buffer',
|
|
1149
|
+
...options,
|
|
1150
|
+
});
|
|
1151
|
+
}
|
|
1152
|
+
const mongoose = getMongoose();
|
|
1153
|
+
return withMongoose(v4.z.custom((val) => (mongoose && val instanceof Buffer) || val instanceof Uint8Array), {
|
|
1154
|
+
type: mongoose?.Schema.Types.Buffer || 'Buffer',
|
|
1155
|
+
...options,
|
|
1156
|
+
});
|
|
1157
|
+
};
|
|
1158
|
+
const zPopulated = (ref, schema, options) => {
|
|
1159
|
+
const isFrontend = getFrontendMode();
|
|
1160
|
+
const mongoose = getMongoose();
|
|
1161
|
+
const objectIdSchema = isFrontend
|
|
1162
|
+
? v4.z.string().regex(/^[\dA-Fa-f]{24}$/, 'Invalid ObjectId')
|
|
1163
|
+
: v4.z.custom((val) => (mongoose && val instanceof mongoose.Types.ObjectId) ||
|
|
1164
|
+
(typeof val === 'string' && /^[\dA-Fa-f]{24}$/.test(val)));
|
|
1165
|
+
return withMongoose(v4.z.union([objectIdSchema, schema]), {
|
|
1166
|
+
type: isFrontend ? 'ObjectId' : mongoose?.Schema.Types.ObjectId || 'ObjectId',
|
|
1167
|
+
ref,
|
|
1168
|
+
...options,
|
|
1169
|
+
});
|
|
1170
|
+
};
|
|
1171
|
+
const DateFieldZod = () => v4.z.date().default(() => new Date());
|
|
1172
|
+
const genTimestampsSchema = (createdAtField = 'createdAt', updatedAtField = 'updatedAt') => {
|
|
1173
|
+
if (createdAtField != null &&
|
|
1174
|
+
updatedAtField != null &&
|
|
1175
|
+
createdAtField === updatedAtField) {
|
|
1176
|
+
throw new Error('`createdAt` and `updatedAt` fields must be different');
|
|
1177
|
+
}
|
|
1178
|
+
const shape = {};
|
|
1179
|
+
if (createdAtField != null) {
|
|
1180
|
+
shape[createdAtField] = withMongoose(DateFieldZod(), { immutable: true, index: true });
|
|
1181
|
+
}
|
|
1182
|
+
if (updatedAtField != null) {
|
|
1183
|
+
shape[updatedAtField] = withMongoose(DateFieldZod(), { index: true });
|
|
1184
|
+
}
|
|
1185
|
+
return shape;
|
|
1186
|
+
};
|
|
1187
|
+
const bufferMongooseGetter = (value) => value != null && value._bsontype === 'Binary' ? value.buffer : value;
|
|
1188
|
+
|
|
1189
|
+
var bufferMongooseGetter_1 = dist.bufferMongooseGetter = bufferMongooseGetter;
|
|
1190
|
+
var callHookSync_1 = dist.callHookSync = callHookSync;
|
|
1191
|
+
var extractMongooseDef_1 = dist.extractMongooseDef = extractMongooseDef;
|
|
1192
|
+
var genTimestampsSchema_1 = dist.genTimestampsSchema = genTimestampsSchema;
|
|
1193
|
+
var getFrontendMode_1 = dist.getFrontendMode = getFrontendMode;
|
|
1194
|
+
var getMongoose_1 = dist.getMongoose = getMongoose;
|
|
1195
|
+
var hooks_1 = dist.hooks = hooks;
|
|
1196
|
+
var mongooseRegistry_1 = dist.mongooseRegistry = mongooseRegistry;
|
|
1197
|
+
var setFrontendMode_1 = dist.setFrontendMode = setFrontendMode;
|
|
1198
|
+
var toMongooseSchema_1 = dist.toMongooseSchema = toMongooseSchema;
|
|
1199
|
+
var withMongoose_1 = dist.withMongoose = withMongoose;
|
|
1200
|
+
var zBuffer_1 = dist.zBuffer = zBuffer;
|
|
1201
|
+
var zObjectId_1 = dist.zObjectId = zObjectId;
|
|
1202
|
+
var zPopulated_1 = dist.zPopulated = zPopulated;
|
|
1203
|
+
|
|
1204
|
+
const mongooseZod = /*#__PURE__*/_mergeNamespaces({
|
|
1205
|
+
__proto__: null,
|
|
1206
|
+
bufferMongooseGetter: bufferMongooseGetter_1,
|
|
1207
|
+
callHookSync: callHookSync_1,
|
|
1208
|
+
default: dist,
|
|
1209
|
+
extractMongooseDef: extractMongooseDef_1,
|
|
1210
|
+
genTimestampsSchema: genTimestampsSchema_1,
|
|
1211
|
+
getFrontendMode: getFrontendMode_1,
|
|
1212
|
+
getMongoose: getMongoose_1,
|
|
1213
|
+
hooks: hooks_1,
|
|
1214
|
+
mongooseRegistry: mongooseRegistry_1,
|
|
1215
|
+
setFrontendMode: setFrontendMode_1,
|
|
1216
|
+
toMongooseSchema: toMongooseSchema_1,
|
|
1217
|
+
withMongoose: withMongoose_1,
|
|
1218
|
+
zBuffer: zBuffer_1,
|
|
1219
|
+
zObjectId: zObjectId_1,
|
|
1220
|
+
zPopulated: zPopulated_1
|
|
1221
|
+
}, [dist]);
|
|
1222
|
+
|
|
1223
|
+
const parse_post = defineEventHandler(async (event) => {
|
|
1224
|
+
const config = useRuntimeConfig(event);
|
|
1225
|
+
const isDocsMode = config.public.isDocsMode;
|
|
1226
|
+
const { sourceCode } = await readBody(event);
|
|
1227
|
+
if (!sourceCode) {
|
|
1228
|
+
throw createError({ statusCode: 400, message: "Missing sourceCode" });
|
|
1229
|
+
}
|
|
1230
|
+
let jsCode = "";
|
|
1231
|
+
try {
|
|
1232
|
+
const result = transformSync(sourceCode, {
|
|
1233
|
+
loader: "ts",
|
|
1234
|
+
format: "cjs",
|
|
1235
|
+
target: "esnext"
|
|
1236
|
+
});
|
|
1237
|
+
jsCode = result.code;
|
|
1238
|
+
} catch (e) {
|
|
1239
|
+
throw createError({
|
|
1240
|
+
statusCode: 400,
|
|
1241
|
+
message: `Compilation Error: ${e.message}`
|
|
1242
|
+
});
|
|
1243
|
+
}
|
|
1244
|
+
const sandboxRequire = (moduleName) => {
|
|
1245
|
+
if (moduleName === "zod" || moduleName === "zod/v4") return zod;
|
|
1246
|
+
if (moduleName === "@nullix/zod-mongoose") return mongooseZod;
|
|
1247
|
+
throw new Error(`Security Exception: Module "${moduleName}" is blocked.`);
|
|
1248
|
+
};
|
|
1249
|
+
const sandbox = {
|
|
1250
|
+
require: sandboxRequire,
|
|
1251
|
+
console: { log: () => {
|
|
1252
|
+
}, warn: () => {
|
|
1253
|
+
}, error: () => {
|
|
1254
|
+
} },
|
|
1255
|
+
__filename: "/sandbox/main.ts",
|
|
1256
|
+
__dirname: "/sandbox"
|
|
1257
|
+
};
|
|
1258
|
+
const context = vm.createContext(sandbox);
|
|
1259
|
+
try {
|
|
1260
|
+
const script = new vm.Script(`
|
|
1261
|
+
(() => {
|
|
1262
|
+
let exports = {};
|
|
1263
|
+
let module = { exports };
|
|
1264
|
+
|
|
1265
|
+
${jsCode}
|
|
1266
|
+
|
|
1267
|
+
return module.exports;
|
|
1268
|
+
})();
|
|
1269
|
+
`);
|
|
1270
|
+
const rawExport = script.runInContext(context, {
|
|
1271
|
+
timeout: isDocsMode ? 1e3 : 5e3
|
|
1272
|
+
});
|
|
1273
|
+
const schema = rawExport.default || rawExport;
|
|
1274
|
+
if (!schema || !schema._def) {
|
|
1275
|
+
throw new Error("You must `export default` a valid Zod schema.");
|
|
1276
|
+
}
|
|
1277
|
+
const extractedDef = extractMongooseDef_1(schema);
|
|
1278
|
+
const mongooseSchema = toMongooseSchema_1(schema);
|
|
1279
|
+
const formatOpts = { depth: null, showHidden: false, colors: false };
|
|
1280
|
+
return {
|
|
1281
|
+
definition: util.inspect(extractedDef, formatOpts),
|
|
1282
|
+
schemaObj: util.inspect(mongooseSchema, formatOpts)
|
|
1283
|
+
};
|
|
1284
|
+
} catch (err) {
|
|
1285
|
+
throw createError({
|
|
1286
|
+
statusCode: 500,
|
|
1287
|
+
message: `Execution Error: ${err.message}`
|
|
1288
|
+
});
|
|
1289
|
+
}
|
|
1290
|
+
});
|
|
1291
|
+
|
|
1292
|
+
export { parse_post as default };
|
|
1293
|
+
//# sourceMappingURL=parse.post.mjs.map
|