@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.
Files changed (876) hide show
  1. package/.output/nitro.json +15 -0
  2. package/.output/public/_nuxt/8SOpv6rk.js +1 -0
  3. package/.output/public/_nuxt/9HpZscsL.js +2 -0
  4. package/.output/public/_nuxt/B2KnRiWG.js +4 -0
  5. package/.output/public/_nuxt/B8OfTtLu.js +1 -0
  6. package/.output/public/_nuxt/BBUBE1dy.js +1 -0
  7. package/.output/public/_nuxt/BBc9UKZt.js +1 -0
  8. package/.output/public/_nuxt/BDtDVThU.js +1 -0
  9. package/.output/public/_nuxt/BEgZUVRK.js +1 -0
  10. package/.output/public/_nuxt/BFxVWTOG.js +1 -0
  11. package/.output/public/_nuxt/BG73LgW2.js +1 -0
  12. package/.output/public/_nuxt/BKILRCQU.js +1 -0
  13. package/.output/public/_nuxt/BOtBlQCF.js +1 -0
  14. package/.output/public/_nuxt/BPhDTwHR.js +1 -0
  15. package/.output/public/_nuxt/BTesnYfV.js +298 -0
  16. package/.output/public/_nuxt/BbWJElDN.js +1 -0
  17. package/.output/public/_nuxt/BcvAzS8a.js +3 -0
  18. package/.output/public/_nuxt/Bd8akH9Z.js +1 -0
  19. package/.output/public/_nuxt/Be1F0pOV.js +1 -0
  20. package/.output/public/_nuxt/BeJ5waoc.js +1 -0
  21. package/.output/public/_nuxt/Bf6VGUru.js +1 -0
  22. package/.output/public/_nuxt/BkW5O-1t.js +1 -0
  23. package/.output/public/_nuxt/BlNEE0v7.js +1 -0
  24. package/.output/public/_nuxt/Brw8urJB.js +2 -0
  25. package/.output/public/_nuxt/Bs9aos_-.js +1 -0
  26. package/.output/public/_nuxt/Bs9z6M-B.js +1 -0
  27. package/.output/public/_nuxt/Btyra-wh.js +1 -0
  28. package/.output/public/_nuxt/Bu5POkcn.js +1 -0
  29. package/.output/public/_nuxt/Bw9ernYp.js +1 -0
  30. package/.output/public/_nuxt/BwHxbl9M.js +1 -0
  31. package/.output/public/_nuxt/BxJiqAUM.js +1 -0
  32. package/.output/public/_nuxt/BzKRNQWT.js +1 -0
  33. package/.output/public/_nuxt/CBJaRo0y.js +3 -0
  34. package/.output/public/_nuxt/CFznDFnq.js +2 -0
  35. package/.output/public/_nuxt/CHwy0fLd.js +1 -0
  36. package/.output/public/_nuxt/CJmd_6j2.js +1 -0
  37. package/.output/public/_nuxt/CMQZ64NL.js +1 -0
  38. package/.output/public/_nuxt/COWaemsV.js +1 -0
  39. package/.output/public/_nuxt/CXBNlu9o.js +1 -0
  40. package/.output/public/_nuxt/C_tMU-Nz.js +1 -0
  41. package/.output/public/_nuxt/CiqrrVzr.js +1 -0
  42. package/.output/public/_nuxt/ClhHkBeG.js +1 -0
  43. package/.output/public/_nuxt/CnS9iZB_.js +1 -0
  44. package/.output/public/_nuxt/CnmFD0ga.js +1 -0
  45. package/.output/public/_nuxt/Co3qMtFm.js +1 -0
  46. package/.output/public/_nuxt/CocnycG-.js +1 -0
  47. package/.output/public/_nuxt/CpO_ztTX.js +1 -0
  48. package/.output/public/_nuxt/CqXO7rUv.js +1 -0
  49. package/.output/public/_nuxt/Csy3S7wG.js +1 -0
  50. package/.output/public/_nuxt/CtU7CIYd.js +11 -0
  51. package/.output/public/_nuxt/Cw6BJv9p.js +908 -0
  52. package/.output/public/_nuxt/Cyyb5UIc.js +1 -0
  53. package/.output/public/_nuxt/D-4FJmMZ.js +1 -0
  54. package/.output/public/_nuxt/D9hQfWCl.js +1 -0
  55. package/.output/public/_nuxt/DARyPmWN.js +1 -0
  56. package/.output/public/_nuxt/DA_xQXIa.js +1 -0
  57. package/.output/public/_nuxt/DIpCSwC3.js +1 -0
  58. package/.output/public/_nuxt/DLDM7-KI.js +1 -0
  59. package/.output/public/_nuxt/DNDY2TF8.js +1 -0
  60. package/.output/public/_nuxt/DSgGBnBI.js +1 -0
  61. package/.output/public/_nuxt/DSh2-awV.js +1 -0
  62. package/.output/public/_nuxt/DWLU9E4j.js +7 -0
  63. package/.output/public/_nuxt/Db0IVjzk.js +1 -0
  64. package/.output/public/_nuxt/Db0cS2oM.js +1 -0
  65. package/.output/public/_nuxt/Dcm9cKUX.js +1 -0
  66. package/.output/public/_nuxt/DdJfP1eB.js +3 -0
  67. package/.output/public/_nuxt/DiJ1NA_G.js +1 -0
  68. package/.output/public/_nuxt/Dj0IH4Bd.js +1 -0
  69. package/.output/public/_nuxt/Dm6ycUr_.js +1 -0
  70. package/.output/public/_nuxt/Dm9fPMHo.js +1 -0
  71. package/.output/public/_nuxt/DmeGPVcC.js +1 -0
  72. package/.output/public/_nuxt/Dnu-v4kV.js +1 -0
  73. package/.output/public/_nuxt/DtV1sZF8.js +1 -0
  74. package/.output/public/_nuxt/DtZ0uQbO.js +1 -0
  75. package/.output/public/_nuxt/DuqnmPmx.js +33 -0
  76. package/.output/public/_nuxt/JqRWe2rp.js +1 -0
  77. package/.output/public/_nuxt/Kd9XrMLS.js +1 -0
  78. package/.output/public/_nuxt/OrD6JF1K.js +1 -0
  79. package/.output/public/_nuxt/PahG7c26.js +1 -0
  80. package/.output/public/_nuxt/Ub6l9XKa.js +1 -0
  81. package/.output/public/_nuxt/XOt5hzHz.js +1 -0
  82. package/.output/public/_nuxt/Y6nb8tq_.js +1 -0
  83. package/.output/public/_nuxt/acbASCJo.js +1 -0
  84. package/.output/public/_nuxt/builds/latest.json +1 -0
  85. package/.output/public/_nuxt/builds/meta/5f8bfdb9-d523-4660-afb9-2a5faf918ee2.json +1 -0
  86. package/.output/public/_nuxt/cCwfBBRk.js +59 -0
  87. package/.output/public/_nuxt/cTPe9QuQ.js +1 -0
  88. package/.output/public/_nuxt/c_t8T7LW.js +1 -0
  89. package/.output/public/_nuxt/cl7-CwDS.js +1 -0
  90. package/.output/public/_nuxt/codicon.ngg6Pgfi.ttf +0 -0
  91. package/.output/public/_nuxt/css.worker-DBVD8oXr.js +93 -0
  92. package/.output/public/_nuxt/editor.CdBKkuhR.css +1 -0
  93. package/.output/public/_nuxt/editor.worker-CdQrwHl8.js +26 -0
  94. package/.output/public/_nuxt/entry.V-_Q9qpd.css +1 -0
  95. package/.output/public/_nuxt/error-404.ZEdaMr7r.css +1 -0
  96. package/.output/public/_nuxt/error-500.CPEQ7gwd.css +1 -0
  97. package/.output/public/_nuxt/html.worker-CwpTb9lJ.js +470 -0
  98. package/.output/public/_nuxt/j7ic8hl3.js +1 -0
  99. package/.output/public/_nuxt/json.worker-BoL8UZqY.js +58 -0
  100. package/.output/public/_nuxt/s7OhZKlX.js +1 -0
  101. package/.output/public/_nuxt/tScXyioY.js +1 -0
  102. package/.output/public/_nuxt/ts.worker-CTGvpNXs.js +67718 -0
  103. package/.output/public/_nuxt/vHIfCaH5.js +1 -0
  104. package/.output/public/_nuxt/zBfavPgS.js +1 -0
  105. package/.output/public/android-chrome-192x192.png +0 -0
  106. package/.output/public/android-chrome-512x512.png +0 -0
  107. package/.output/public/apple-touch-icon.png +0 -0
  108. package/.output/public/favicon-16x16.png +0 -0
  109. package/.output/public/favicon-32x32.png +0 -0
  110. package/.output/public/favicon.ico +0 -0
  111. package/.output/public/robots.txt +2 -0
  112. package/.output/public/site.webmanifest +1 -0
  113. package/.output/public/zodmongoose-b.jpg +0 -0
  114. package/.output/public/zodmongoose-b.png +0 -0
  115. package/.output/public/zodmongoose-b.svg +10 -0
  116. package/.output/public/zodmongoose.jpg +0 -0
  117. package/.output/public/zodmongoose.png +0 -0
  118. package/.output/public/zodmongoose.svg +12 -0
  119. package/.output/server/chunks/_/error-500.mjs +19 -0
  120. package/.output/server/chunks/_/error-500.mjs.map +1 -0
  121. package/.output/server/chunks/build/client.precomputed.mjs +4 -0
  122. package/.output/server/chunks/build/client.precomputed.mjs.map +1 -0
  123. package/.output/server/chunks/build/error-404-C01T0Fs3.mjs +93 -0
  124. package/.output/server/chunks/build/error-404-C01T0Fs3.mjs.map +1 -0
  125. package/.output/server/chunks/build/error-404-styles.C9SFt1Pa.mjs +8 -0
  126. package/.output/server/chunks/build/error-404-styles.C9SFt1Pa.mjs.map +1 -0
  127. package/.output/server/chunks/build/error-500-BxPzc_RO.mjs +76 -0
  128. package/.output/server/chunks/build/error-500-BxPzc_RO.mjs.map +1 -0
  129. package/.output/server/chunks/build/error-500-styles.BgBkJrKx.mjs +8 -0
  130. package/.output/server/chunks/build/error-500-styles.BgBkJrKx.mjs.map +1 -0
  131. package/.output/server/chunks/build/index-Cm3PgUzj.mjs +504 -0
  132. package/.output/server/chunks/build/index-Cm3PgUzj.mjs.map +1 -0
  133. package/.output/server/chunks/build/server.mjs +14569 -0
  134. package/.output/server/chunks/build/server.mjs.map +1 -0
  135. package/.output/server/chunks/build/styles.mjs +10 -0
  136. package/.output/server/chunks/build/styles.mjs.map +1 -0
  137. package/.output/server/chunks/nitro/nitro.mjs +6533 -0
  138. package/.output/server/chunks/nitro/nitro.mjs.map +1 -0
  139. package/.output/server/chunks/routes/api/parse.post.mjs +1293 -0
  140. package/.output/server/chunks/routes/api/parse.post.mjs.map +1 -0
  141. package/.output/server/chunks/routes/api/resolve.get.mjs +42 -0
  142. package/.output/server/chunks/routes/api/resolve.get.mjs.map +1 -0
  143. package/.output/server/chunks/routes/renderer.mjs +483 -0
  144. package/.output/server/chunks/routes/renderer.mjs.map +1 -0
  145. package/.output/server/chunks/virtual/_virtual_spa-template.mjs +4 -0
  146. package/.output/server/chunks/virtual/_virtual_spa-template.mjs.map +1 -0
  147. package/.output/server/index.mjs +12 -0
  148. package/.output/server/index.mjs.map +1 -0
  149. package/.output/server/node_modules/@babel/parser/lib/index.js +14582 -0
  150. package/.output/server/node_modules/@babel/parser/package.json +50 -0
  151. package/.output/server/node_modules/@esbuild/darwin-arm64/bin/esbuild +0 -0
  152. package/.output/server/node_modules/@esbuild/darwin-arm64/package.json +20 -0
  153. package/.output/server/node_modules/@iconify/utils/lib/colors/index.js +292 -0
  154. package/.output/server/node_modules/@iconify/utils/lib/colors/keywords.js +702 -0
  155. package/.output/server/node_modules/@iconify/utils/lib/css/common.js +76 -0
  156. package/.output/server/node_modules/@iconify/utils/lib/css/format.js +40 -0
  157. package/.output/server/node_modules/@iconify/utils/lib/css/icon.js +52 -0
  158. package/.output/server/node_modules/@iconify/utils/lib/css/icons.js +133 -0
  159. package/.output/server/node_modules/@iconify/utils/lib/customisations/bool.js +20 -0
  160. package/.output/server/node_modules/@iconify/utils/lib/customisations/defaults.js +15 -0
  161. package/.output/server/node_modules/@iconify/utils/lib/customisations/flip.js +18 -0
  162. package/.output/server/node_modules/@iconify/utils/lib/customisations/merge.js +18 -0
  163. package/.output/server/node_modules/@iconify/utils/lib/customisations/rotate.js +31 -0
  164. package/.output/server/node_modules/@iconify/utils/lib/emoji/cleanup.js +80 -0
  165. package/.output/server/node_modules/@iconify/utils/lib/emoji/convert.js +102 -0
  166. package/.output/server/node_modules/@iconify/utils/lib/emoji/data.js +29 -0
  167. package/.output/server/node_modules/@iconify/utils/lib/emoji/format.js +60 -0
  168. package/.output/server/node_modules/@iconify/utils/lib/emoji/parse.js +50 -0
  169. package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/base.js +204 -0
  170. package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/create.js +35 -0
  171. package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/numbers.js +134 -0
  172. package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/similar.js +167 -0
  173. package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/tree.js +81 -0
  174. package/.output/server/node_modules/@iconify/utils/lib/emoji/replace/find.js +94 -0
  175. package/.output/server/node_modules/@iconify/utils/lib/emoji/replace/replace.js +28 -0
  176. package/.output/server/node_modules/@iconify/utils/lib/emoji/test/components.js +78 -0
  177. package/.output/server/node_modules/@iconify/utils/lib/emoji/test/missing.js +68 -0
  178. package/.output/server/node_modules/@iconify/utils/lib/emoji/test/name.js +47 -0
  179. package/.output/server/node_modules/@iconify/utils/lib/emoji/test/parse.js +105 -0
  180. package/.output/server/node_modules/@iconify/utils/lib/emoji/test/similar.js +38 -0
  181. package/.output/server/node_modules/@iconify/utils/lib/emoji/test/tree.js +94 -0
  182. package/.output/server/node_modules/@iconify/utils/lib/emoji/test/variations.js +64 -0
  183. package/.output/server/node_modules/@iconify/utils/lib/icon/defaults.js +26 -0
  184. package/.output/server/node_modules/@iconify/utils/lib/icon/merge.js +18 -0
  185. package/.output/server/node_modules/@iconify/utils/lib/icon/name.js +58 -0
  186. package/.output/server/node_modules/@iconify/utils/lib/icon/square.js +34 -0
  187. package/.output/server/node_modules/@iconify/utils/lib/icon/transformations.js +13 -0
  188. package/.output/server/node_modules/@iconify/utils/lib/icon-set/convert-info.js +126 -0
  189. package/.output/server/node_modules/@iconify/utils/lib/icon-set/expand.js +21 -0
  190. package/.output/server/node_modules/@iconify/utils/lib/icon-set/get-icon.js +27 -0
  191. package/.output/server/node_modules/@iconify/utils/lib/icon-set/get-icons.js +38 -0
  192. package/.output/server/node_modules/@iconify/utils/lib/icon-set/minify.js +93 -0
  193. package/.output/server/node_modules/@iconify/utils/lib/icon-set/parse.js +48 -0
  194. package/.output/server/node_modules/@iconify/utils/lib/icon-set/tree.js +24 -0
  195. package/.output/server/node_modules/@iconify/utils/lib/icon-set/validate-basic.js +44 -0
  196. package/.output/server/node_modules/@iconify/utils/lib/icon-set/validate.js +125 -0
  197. package/.output/server/node_modules/@iconify/utils/lib/index.js +53 -0
  198. package/.output/server/node_modules/@iconify/utils/lib/loader/custom.js +32 -0
  199. package/.output/server/node_modules/@iconify/utils/lib/loader/loader.js +28 -0
  200. package/.output/server/node_modules/@iconify/utils/lib/loader/modern.js +42 -0
  201. package/.output/server/node_modules/@iconify/utils/lib/loader/utils.js +63 -0
  202. package/.output/server/node_modules/@iconify/utils/lib/misc/objects.js +27 -0
  203. package/.output/server/node_modules/@iconify/utils/lib/misc/strings.js +27 -0
  204. package/.output/server/node_modules/@iconify/utils/lib/misc/title.js +10 -0
  205. package/.output/server/node_modules/@iconify/utils/lib/svg/build.js +115 -0
  206. package/.output/server/node_modules/@iconify/utils/lib/svg/defs.js +32 -0
  207. package/.output/server/node_modules/@iconify/utils/lib/svg/encode-svg-for-css.js +15 -0
  208. package/.output/server/node_modules/@iconify/utils/lib/svg/html.js +10 -0
  209. package/.output/server/node_modules/@iconify/utils/lib/svg/id.js +42 -0
  210. package/.output/server/node_modules/@iconify/utils/lib/svg/inner-html.js +23 -0
  211. package/.output/server/node_modules/@iconify/utils/lib/svg/parse.js +69 -0
  212. package/.output/server/node_modules/@iconify/utils/lib/svg/pretty.js +55 -0
  213. package/.output/server/node_modules/@iconify/utils/lib/svg/size.js +28 -0
  214. package/.output/server/node_modules/@iconify/utils/lib/svg/trim.js +8 -0
  215. package/.output/server/node_modules/@iconify/utils/lib/svg/url.js +23 -0
  216. package/.output/server/node_modules/@iconify/utils/lib/svg/viewbox.js +9 -0
  217. package/.output/server/node_modules/@iconify/utils/package.json +118 -0
  218. package/.output/server/node_modules/@mongodb-js/saslprep/dist/code-points-data.js +5 -0
  219. package/.output/server/node_modules/@mongodb-js/saslprep/dist/index.js +65 -0
  220. package/.output/server/node_modules/@mongodb-js/saslprep/dist/memory-code-points.js +32 -0
  221. package/.output/server/node_modules/@mongodb-js/saslprep/dist/node.js +15 -0
  222. package/.output/server/node_modules/@mongodb-js/saslprep/package.json +87 -0
  223. package/.output/server/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js +6763 -0
  224. package/.output/server/node_modules/@vue/compiler-core/package.json +58 -0
  225. package/.output/server/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js +689 -0
  226. package/.output/server/node_modules/@vue/compiler-dom/package.json +57 -0
  227. package/.output/server/node_modules/@vue/compiler-ssr/dist/compiler-ssr.cjs.js +1413 -0
  228. package/.output/server/node_modules/@vue/compiler-ssr/package.json +34 -0
  229. package/.output/server/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js +1877 -0
  230. package/.output/server/node_modules/@vue/reactivity/package.json +55 -0
  231. package/.output/server/node_modules/@vue/runtime-core/dist/runtime-core.cjs.prod.js +6856 -0
  232. package/.output/server/node_modules/@vue/runtime-core/package.json +52 -0
  233. package/.output/server/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.prod.js +1796 -0
  234. package/.output/server/node_modules/@vue/runtime-dom/package.json +60 -0
  235. package/.output/server/node_modules/@vue/server-renderer/dist/server-renderer.cjs.prod.js +883 -0
  236. package/.output/server/node_modules/@vue/server-renderer/package.json +55 -0
  237. package/.output/server/node_modules/@vue/shared/dist/shared.cjs.prod.js +604 -0
  238. package/.output/server/node_modules/@vue/shared/package.json +47 -0
  239. package/.output/server/node_modules/bson/lib/bson.cjs +4636 -0
  240. package/.output/server/node_modules/bson/package.json +120 -0
  241. package/.output/server/node_modules/consola/dist/chunks/prompt.mjs +280 -0
  242. package/.output/server/node_modules/consola/dist/core.mjs +512 -0
  243. package/.output/server/node_modules/consola/dist/index.mjs +651 -0
  244. package/.output/server/node_modules/consola/dist/shared/consola.DRwqZj3T.mjs +72 -0
  245. package/.output/server/node_modules/consola/dist/shared/consola.DXBYu-KD.mjs +288 -0
  246. package/.output/server/node_modules/consola/package.json +136 -0
  247. package/.output/server/node_modules/debug/package.json +64 -0
  248. package/.output/server/node_modules/debug/src/browser.js +272 -0
  249. package/.output/server/node_modules/debug/src/common.js +292 -0
  250. package/.output/server/node_modules/debug/src/index.js +10 -0
  251. package/.output/server/node_modules/debug/src/node.js +263 -0
  252. package/.output/server/node_modules/devalue/index.js +4 -0
  253. package/.output/server/node_modules/devalue/package.json +37 -0
  254. package/.output/server/node_modules/devalue/src/base64.js +110 -0
  255. package/.output/server/node_modules/devalue/src/constants.js +7 -0
  256. package/.output/server/node_modules/devalue/src/parse.js +265 -0
  257. package/.output/server/node_modules/devalue/src/stringify.js +350 -0
  258. package/.output/server/node_modules/devalue/src/uneval.js +490 -0
  259. package/.output/server/node_modules/devalue/src/utils.js +148 -0
  260. package/.output/server/node_modules/entities/dist/commonjs/decode-codepoint.js +77 -0
  261. package/.output/server/node_modules/entities/dist/commonjs/decode.js +568 -0
  262. package/.output/server/node_modules/entities/dist/commonjs/generated/decode-data-html.js +7 -0
  263. package/.output/server/node_modules/entities/dist/commonjs/generated/decode-data-xml.js +7 -0
  264. package/.output/server/node_modules/entities/dist/commonjs/internal/bin-trie-flags.js +21 -0
  265. package/.output/server/node_modules/entities/dist/commonjs/internal/decode-shared.js +31 -0
  266. package/.output/server/node_modules/entities/dist/commonjs/package.json +3 -0
  267. package/.output/server/node_modules/entities/package.json +120 -0
  268. package/.output/server/node_modules/esbuild/lib/main.js +2532 -0
  269. package/.output/server/node_modules/esbuild/package.json +74 -0
  270. package/.output/server/node_modules/estree-walker/dist/umd/estree-walker.js +344 -0
  271. package/.output/server/node_modules/estree-walker/package.json +37 -0
  272. package/.output/server/node_modules/hookable/dist/index.mjs +266 -0
  273. package/.output/server/node_modules/hookable/package.json +53 -0
  274. package/.output/server/node_modules/ip-address/dist/address-error.js +12 -0
  275. package/.output/server/node_modules/ip-address/dist/common.js +46 -0
  276. package/.output/server/node_modules/ip-address/dist/ip-address.js +35 -0
  277. package/.output/server/node_modules/ip-address/dist/ipv4.js +360 -0
  278. package/.output/server/node_modules/ip-address/dist/ipv6.js +1003 -0
  279. package/.output/server/node_modules/ip-address/dist/v4/constants.js +8 -0
  280. package/.output/server/node_modules/ip-address/dist/v6/constants.js +76 -0
  281. package/.output/server/node_modules/ip-address/dist/v6/helpers.js +45 -0
  282. package/.output/server/node_modules/ip-address/dist/v6/regular-expressions.js +95 -0
  283. package/.output/server/node_modules/ip-address/package.json +78 -0
  284. package/.output/server/node_modules/kareem/index.js +668 -0
  285. package/.output/server/node_modules/kareem/package.json +28 -0
  286. package/.output/server/node_modules/memory-pager/index.js +160 -0
  287. package/.output/server/node_modules/memory-pager/package.json +24 -0
  288. package/.output/server/node_modules/mongodb/lib/admin.js +136 -0
  289. package/.output/server/node_modules/mongodb/lib/bson.js +84 -0
  290. package/.output/server/node_modules/mongodb/lib/bulk/common.js +837 -0
  291. package/.output/server/node_modules/mongodb/lib/bulk/ordered.js +67 -0
  292. package/.output/server/node_modules/mongodb/lib/bulk/unordered.js +92 -0
  293. package/.output/server/node_modules/mongodb/lib/change_stream.js +465 -0
  294. package/.output/server/node_modules/mongodb/lib/client-side-encryption/auto_encrypter.js +274 -0
  295. package/.output/server/node_modules/mongodb/lib/client-side-encryption/client_encryption.js +610 -0
  296. package/.output/server/node_modules/mongodb/lib/client-side-encryption/crypto_callbacks.js +81 -0
  297. package/.output/server/node_modules/mongodb/lib/client-side-encryption/errors.js +136 -0
  298. package/.output/server/node_modules/mongodb/lib/client-side-encryption/mongocryptd_manager.js +85 -0
  299. package/.output/server/node_modules/mongodb/lib/client-side-encryption/providers/aws.js +23 -0
  300. package/.output/server/node_modules/mongodb/lib/client-side-encryption/providers/azure.js +132 -0
  301. package/.output/server/node_modules/mongodb/lib/client-side-encryption/providers/gcp.js +16 -0
  302. package/.output/server/node_modules/mongodb/lib/client-side-encryption/providers/index.js +43 -0
  303. package/.output/server/node_modules/mongodb/lib/client-side-encryption/state_machine.js +426 -0
  304. package/.output/server/node_modules/mongodb/lib/cmap/auth/auth_provider.js +51 -0
  305. package/.output/server/node_modules/mongodb/lib/cmap/auth/aws_temporary_credentials.js +150 -0
  306. package/.output/server/node_modules/mongodb/lib/cmap/auth/gssapi.js +154 -0
  307. package/.output/server/node_modules/mongodb/lib/cmap/auth/mongo_credentials.js +183 -0
  308. package/.output/server/node_modules/mongodb/lib/cmap/auth/mongodb_aws.js +138 -0
  309. package/.output/server/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/automated_callback_workflow.js +84 -0
  310. package/.output/server/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/azure_machine_workflow.js +62 -0
  311. package/.output/server/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/callback_workflow.js +141 -0
  312. package/.output/server/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/command_builders.js +44 -0
  313. package/.output/server/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/gcp_machine_workflow.js +39 -0
  314. package/.output/server/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/human_callback_workflow.js +122 -0
  315. package/.output/server/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/k8s_machine_workflow.js +31 -0
  316. package/.output/server/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_cache.js +52 -0
  317. package/.output/server/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_machine_workflow.js +22 -0
  318. package/.output/server/node_modules/mongodb/lib/cmap/auth/mongodb_oidc.js +73 -0
  319. package/.output/server/node_modules/mongodb/lib/cmap/auth/plain.js +26 -0
  320. package/.output/server/node_modules/mongodb/lib/cmap/auth/providers.js +23 -0
  321. package/.output/server/node_modules/mongodb/lib/cmap/auth/scram.js +254 -0
  322. package/.output/server/node_modules/mongodb/lib/cmap/auth/x509.js +36 -0
  323. package/.output/server/node_modules/mongodb/lib/cmap/command_monitoring_events.js +223 -0
  324. package/.output/server/node_modules/mongodb/lib/cmap/commands.js +535 -0
  325. package/.output/server/node_modules/mongodb/lib/cmap/connect.js +366 -0
  326. package/.output/server/node_modules/mongodb/lib/cmap/connection.js +570 -0
  327. package/.output/server/node_modules/mongodb/lib/cmap/connection_pool.js +558 -0
  328. package/.output/server/node_modules/mongodb/lib/cmap/connection_pool_events.js +190 -0
  329. package/.output/server/node_modules/mongodb/lib/cmap/errors.js +108 -0
  330. package/.output/server/node_modules/mongodb/lib/cmap/handshake/client_metadata.js +239 -0
  331. package/.output/server/node_modules/mongodb/lib/cmap/metrics.js +62 -0
  332. package/.output/server/node_modules/mongodb/lib/cmap/stream_description.js +70 -0
  333. package/.output/server/node_modules/mongodb/lib/cmap/wire_protocol/compression.js +163 -0
  334. package/.output/server/node_modules/mongodb/lib/cmap/wire_protocol/constants.js +19 -0
  335. package/.output/server/node_modules/mongodb/lib/cmap/wire_protocol/on_data.js +112 -0
  336. package/.output/server/node_modules/mongodb/lib/cmap/wire_protocol/on_demand/document.js +222 -0
  337. package/.output/server/node_modules/mongodb/lib/cmap/wire_protocol/responses.js +315 -0
  338. package/.output/server/node_modules/mongodb/lib/cmap/wire_protocol/shared.js +35 -0
  339. package/.output/server/node_modules/mongodb/lib/collection.js +751 -0
  340. package/.output/server/node_modules/mongodb/lib/connection_string.js +1091 -0
  341. package/.output/server/node_modules/mongodb/lib/constants.js +170 -0
  342. package/.output/server/node_modules/mongodb/lib/cursor/abstract_cursor.js +941 -0
  343. package/.output/server/node_modules/mongodb/lib/cursor/aggregation_cursor.js +164 -0
  344. package/.output/server/node_modules/mongodb/lib/cursor/change_stream_cursor.js +104 -0
  345. package/.output/server/node_modules/mongodb/lib/cursor/client_bulk_write_cursor.js +52 -0
  346. package/.output/server/node_modules/mongodb/lib/cursor/explainable_cursor.js +36 -0
  347. package/.output/server/node_modules/mongodb/lib/cursor/find_cursor.js +388 -0
  348. package/.output/server/node_modules/mongodb/lib/cursor/list_collections_cursor.js +34 -0
  349. package/.output/server/node_modules/mongodb/lib/cursor/list_indexes_cursor.js +32 -0
  350. package/.output/server/node_modules/mongodb/lib/cursor/list_search_indexes_cursor.js +14 -0
  351. package/.output/server/node_modules/mongodb/lib/cursor/run_command_cursor.js +94 -0
  352. package/.output/server/node_modules/mongodb/lib/db.js +420 -0
  353. package/.output/server/node_modules/mongodb/lib/deps.js +125 -0
  354. package/.output/server/node_modules/mongodb/lib/encrypter.js +106 -0
  355. package/.output/server/node_modules/mongodb/lib/error.js +1383 -0
  356. package/.output/server/node_modules/mongodb/lib/explain.js +59 -0
  357. package/.output/server/node_modules/mongodb/lib/gridfs/download.js +305 -0
  358. package/.output/server/node_modules/mongodb/lib/gridfs/index.js +164 -0
  359. package/.output/server/node_modules/mongodb/lib/gridfs/upload.js +364 -0
  360. package/.output/server/node_modules/mongodb/lib/index.js +195 -0
  361. package/.output/server/node_modules/mongodb/lib/mongo_client.js +566 -0
  362. package/.output/server/node_modules/mongodb/lib/mongo_client_auth_providers.js +86 -0
  363. package/.output/server/node_modules/mongodb/lib/mongo_logger.js +649 -0
  364. package/.output/server/node_modules/mongodb/lib/mongo_types.js +57 -0
  365. package/.output/server/node_modules/mongodb/lib/operations/aggregate.js +93 -0
  366. package/.output/server/node_modules/mongodb/lib/operations/client_bulk_write/client_bulk_write.js +51 -0
  367. package/.output/server/node_modules/mongodb/lib/operations/client_bulk_write/command_builder.js +340 -0
  368. package/.output/server/node_modules/mongodb/lib/operations/client_bulk_write/executor.js +120 -0
  369. package/.output/server/node_modules/mongodb/lib/operations/client_bulk_write/results_merger.js +204 -0
  370. package/.output/server/node_modules/mongodb/lib/operations/command.js +83 -0
  371. package/.output/server/node_modules/mongodb/lib/operations/count.js +45 -0
  372. package/.output/server/node_modules/mongodb/lib/operations/create_collection.js +110 -0
  373. package/.output/server/node_modules/mongodb/lib/operations/delete.js +125 -0
  374. package/.output/server/node_modules/mongodb/lib/operations/distinct.js +61 -0
  375. package/.output/server/node_modules/mongodb/lib/operations/drop.js +94 -0
  376. package/.output/server/node_modules/mongodb/lib/operations/estimated_document_count.js +41 -0
  377. package/.output/server/node_modules/mongodb/lib/operations/execute_operation.js +236 -0
  378. package/.output/server/node_modules/mongodb/lib/operations/find.js +148 -0
  379. package/.output/server/node_modules/mongodb/lib/operations/find_and_modify.js +158 -0
  380. package/.output/server/node_modules/mongodb/lib/operations/get_more.js +62 -0
  381. package/.output/server/node_modules/mongodb/lib/operations/indexes.js +186 -0
  382. package/.output/server/node_modules/mongodb/lib/operations/insert.js +70 -0
  383. package/.output/server/node_modules/mongodb/lib/operations/kill_cursors.js +43 -0
  384. package/.output/server/node_modules/mongodb/lib/operations/list_collections.js +53 -0
  385. package/.output/server/node_modules/mongodb/lib/operations/list_databases.js +40 -0
  386. package/.output/server/node_modules/mongodb/lib/operations/operation.js +102 -0
  387. package/.output/server/node_modules/mongodb/lib/operations/profiling_level.js +43 -0
  388. package/.output/server/node_modules/mongodb/lib/operations/remove_user.js +27 -0
  389. package/.output/server/node_modules/mongodb/lib/operations/rename.js +38 -0
  390. package/.output/server/node_modules/mongodb/lib/operations/run_command.js +47 -0
  391. package/.output/server/node_modules/mongodb/lib/operations/search_indexes/create.js +33 -0
  392. package/.output/server/node_modules/mongodb/lib/operations/search_indexes/drop.js +43 -0
  393. package/.output/server/node_modules/mongodb/lib/operations/search_indexes/update.js +35 -0
  394. package/.output/server/node_modules/mongodb/lib/operations/set_profiling_level.js +53 -0
  395. package/.output/server/node_modules/mongodb/lib/operations/stats.js +27 -0
  396. package/.output/server/node_modules/mongodb/lib/operations/update.js +188 -0
  397. package/.output/server/node_modules/mongodb/lib/operations/validate_collection.js +37 -0
  398. package/.output/server/node_modules/mongodb/lib/read_concern.js +73 -0
  399. package/.output/server/node_modules/mongodb/lib/read_preference.js +195 -0
  400. package/.output/server/node_modules/mongodb/lib/resource_management.js +58 -0
  401. package/.output/server/node_modules/mongodb/lib/sdam/common.js +49 -0
  402. package/.output/server/node_modules/mongodb/lib/sdam/events.js +146 -0
  403. package/.output/server/node_modules/mongodb/lib/sdam/monitor.js +544 -0
  404. package/.output/server/node_modules/mongodb/lib/sdam/server.js +392 -0
  405. package/.output/server/node_modules/mongodb/lib/sdam/server_description.js +204 -0
  406. package/.output/server/node_modules/mongodb/lib/sdam/server_selection.js +231 -0
  407. package/.output/server/node_modules/mongodb/lib/sdam/server_selection_events.js +85 -0
  408. package/.output/server/node_modules/mongodb/lib/sdam/srv_polling.js +108 -0
  409. package/.output/server/node_modules/mongodb/lib/sdam/topology.js +694 -0
  410. package/.output/server/node_modules/mongodb/lib/sdam/topology_description.js +383 -0
  411. package/.output/server/node_modules/mongodb/lib/sessions.js +827 -0
  412. package/.output/server/node_modules/mongodb/lib/sort.js +103 -0
  413. package/.output/server/node_modules/mongodb/lib/timeout.js +296 -0
  414. package/.output/server/node_modules/mongodb/lib/transactions.js +146 -0
  415. package/.output/server/node_modules/mongodb/lib/utils.js +1203 -0
  416. package/.output/server/node_modules/mongodb/lib/write_concern.js +100 -0
  417. package/.output/server/node_modules/mongodb/package.json +178 -0
  418. package/.output/server/node_modules/mongodb-connection-string-url/lib/index.js +213 -0
  419. package/.output/server/node_modules/mongodb-connection-string-url/lib/redact.js +86 -0
  420. package/.output/server/node_modules/mongodb-connection-string-url/package.json +62 -0
  421. package/.output/server/node_modules/mongoose/index.js +64 -0
  422. package/.output/server/node_modules/mongoose/lib/aggregate.js +1245 -0
  423. package/.output/server/node_modules/mongoose/lib/browserDocument.js +101 -0
  424. package/.output/server/node_modules/mongoose/lib/cast/bigint.js +46 -0
  425. package/.output/server/node_modules/mongoose/lib/cast/boolean.js +32 -0
  426. package/.output/server/node_modules/mongoose/lib/cast/date.js +41 -0
  427. package/.output/server/node_modules/mongoose/lib/cast/decimal128.js +39 -0
  428. package/.output/server/node_modules/mongoose/lib/cast/double.js +50 -0
  429. package/.output/server/node_modules/mongoose/lib/cast/int32.js +36 -0
  430. package/.output/server/node_modules/mongoose/lib/cast/number.js +42 -0
  431. package/.output/server/node_modules/mongoose/lib/cast/objectid.js +29 -0
  432. package/.output/server/node_modules/mongoose/lib/cast/string.js +37 -0
  433. package/.output/server/node_modules/mongoose/lib/cast/uuid.js +78 -0
  434. package/.output/server/node_modules/mongoose/lib/cast.js +444 -0
  435. package/.output/server/node_modules/mongoose/lib/collection.js +321 -0
  436. package/.output/server/node_modules/mongoose/lib/connection.js +1850 -0
  437. package/.output/server/node_modules/mongoose/lib/connectionState.js +26 -0
  438. package/.output/server/node_modules/mongoose/lib/constants.js +73 -0
  439. package/.output/server/node_modules/mongoose/lib/cursor/aggregationCursor.js +476 -0
  440. package/.output/server/node_modules/mongoose/lib/cursor/changeStream.js +198 -0
  441. package/.output/server/node_modules/mongoose/lib/cursor/queryCursor.js +629 -0
  442. package/.output/server/node_modules/mongoose/lib/document.js +5512 -0
  443. package/.output/server/node_modules/mongoose/lib/documentProvider.js +30 -0
  444. package/.output/server/node_modules/mongoose/lib/driver.js +15 -0
  445. package/.output/server/node_modules/mongoose/lib/drivers/node-mongodb-native/bulkWriteResult.js +5 -0
  446. package/.output/server/node_modules/mongoose/lib/drivers/node-mongodb-native/collection.js +471 -0
  447. package/.output/server/node_modules/mongoose/lib/drivers/node-mongodb-native/connection.js +528 -0
  448. package/.output/server/node_modules/mongoose/lib/drivers/node-mongodb-native/index.js +10 -0
  449. package/.output/server/node_modules/mongoose/lib/error/bulkSaveIncompleteError.js +44 -0
  450. package/.output/server/node_modules/mongoose/lib/error/bulkWriteError.js +41 -0
  451. package/.output/server/node_modules/mongoose/lib/error/cast.js +158 -0
  452. package/.output/server/node_modules/mongoose/lib/error/createCollectionsError.js +26 -0
  453. package/.output/server/node_modules/mongoose/lib/error/divergentArray.js +40 -0
  454. package/.output/server/node_modules/mongoose/lib/error/eachAsyncMultiError.js +41 -0
  455. package/.output/server/node_modules/mongoose/lib/error/index.js +237 -0
  456. package/.output/server/node_modules/mongoose/lib/error/invalidSchemaOption.js +32 -0
  457. package/.output/server/node_modules/mongoose/lib/error/messages.js +47 -0
  458. package/.output/server/node_modules/mongoose/lib/error/missingSchema.js +33 -0
  459. package/.output/server/node_modules/mongoose/lib/error/mongooseError.js +13 -0
  460. package/.output/server/node_modules/mongoose/lib/error/notFound.js +47 -0
  461. package/.output/server/node_modules/mongoose/lib/error/objectExpected.js +31 -0
  462. package/.output/server/node_modules/mongoose/lib/error/objectParameter.js +32 -0
  463. package/.output/server/node_modules/mongoose/lib/error/overwriteModel.js +31 -0
  464. package/.output/server/node_modules/mongoose/lib/error/parallelSave.js +33 -0
  465. package/.output/server/node_modules/mongoose/lib/error/parallelValidate.js +33 -0
  466. package/.output/server/node_modules/mongoose/lib/error/serverSelection.js +62 -0
  467. package/.output/server/node_modules/mongoose/lib/error/setOptionError.js +103 -0
  468. package/.output/server/node_modules/mongoose/lib/error/strict.js +35 -0
  469. package/.output/server/node_modules/mongoose/lib/error/strictPopulate.js +31 -0
  470. package/.output/server/node_modules/mongoose/lib/error/syncIndexes.js +30 -0
  471. package/.output/server/node_modules/mongoose/lib/error/validation.js +105 -0
  472. package/.output/server/node_modules/mongoose/lib/error/validator.js +100 -0
  473. package/.output/server/node_modules/mongoose/lib/error/version.js +38 -0
  474. package/.output/server/node_modules/mongoose/lib/helpers/aggregate/prepareDiscriminatorPipeline.js +39 -0
  475. package/.output/server/node_modules/mongoose/lib/helpers/aggregate/stringifyFunctionOperators.js +50 -0
  476. package/.output/server/node_modules/mongoose/lib/helpers/arrayDepth.js +33 -0
  477. package/.output/server/node_modules/mongoose/lib/helpers/clone.js +236 -0
  478. package/.output/server/node_modules/mongoose/lib/helpers/common.js +127 -0
  479. package/.output/server/node_modules/mongoose/lib/helpers/createJSONSchemaTypeDefinition.js +24 -0
  480. package/.output/server/node_modules/mongoose/lib/helpers/cursor/eachAsync.js +225 -0
  481. package/.output/server/node_modules/mongoose/lib/helpers/discriminator/applyEmbeddedDiscriminators.js +36 -0
  482. package/.output/server/node_modules/mongoose/lib/helpers/discriminator/areDiscriminatorValuesEqual.js +16 -0
  483. package/.output/server/node_modules/mongoose/lib/helpers/discriminator/checkEmbeddedDiscriminatorKeyProjection.js +12 -0
  484. package/.output/server/node_modules/mongoose/lib/helpers/discriminator/getConstructor.js +29 -0
  485. package/.output/server/node_modules/mongoose/lib/helpers/discriminator/getDiscriminatorByValue.js +28 -0
  486. package/.output/server/node_modules/mongoose/lib/helpers/discriminator/getSchemaDiscriminatorByValue.js +27 -0
  487. package/.output/server/node_modules/mongoose/lib/helpers/discriminator/mergeDiscriminatorSchema.js +91 -0
  488. package/.output/server/node_modules/mongoose/lib/helpers/document/applyDefaults.js +132 -0
  489. package/.output/server/node_modules/mongoose/lib/helpers/document/applyTimestamps.js +105 -0
  490. package/.output/server/node_modules/mongoose/lib/helpers/document/applyVirtuals.js +146 -0
  491. package/.output/server/node_modules/mongoose/lib/helpers/document/cleanModifiedSubpaths.js +45 -0
  492. package/.output/server/node_modules/mongoose/lib/helpers/document/compile.js +238 -0
  493. package/.output/server/node_modules/mongoose/lib/helpers/document/getDeepestSubdocumentForPath.js +38 -0
  494. package/.output/server/node_modules/mongoose/lib/helpers/document/getEmbeddedDiscriminatorPath.js +53 -0
  495. package/.output/server/node_modules/mongoose/lib/helpers/document/handleSpreadDoc.js +35 -0
  496. package/.output/server/node_modules/mongoose/lib/helpers/each.js +25 -0
  497. package/.output/server/node_modules/mongoose/lib/helpers/error/combinePathErrors.js +22 -0
  498. package/.output/server/node_modules/mongoose/lib/helpers/firstKey.js +8 -0
  499. package/.output/server/node_modules/mongoose/lib/helpers/get.js +65 -0
  500. package/.output/server/node_modules/mongoose/lib/helpers/getConstructorName.js +16 -0
  501. package/.output/server/node_modules/mongoose/lib/helpers/getDefaultBulkwriteResult.js +18 -0
  502. package/.output/server/node_modules/mongoose/lib/helpers/getFunctionName.js +10 -0
  503. package/.output/server/node_modules/mongoose/lib/helpers/immediate.js +16 -0
  504. package/.output/server/node_modules/mongoose/lib/helpers/indexes/applySchemaCollation.js +13 -0
  505. package/.output/server/node_modules/mongoose/lib/helpers/indexes/decorateDiscriminatorIndexOptions.js +14 -0
  506. package/.output/server/node_modules/mongoose/lib/helpers/indexes/getRelatedIndexes.js +63 -0
  507. package/.output/server/node_modules/mongoose/lib/helpers/indexes/isDefaultIdIndex.js +18 -0
  508. package/.output/server/node_modules/mongoose/lib/helpers/indexes/isIndexEqual.js +96 -0
  509. package/.output/server/node_modules/mongoose/lib/helpers/indexes/isIndexSpecEqual.js +32 -0
  510. package/.output/server/node_modules/mongoose/lib/helpers/indexes/isTextIndex.js +16 -0
  511. package/.output/server/node_modules/mongoose/lib/helpers/indexes/isTimeseriesIndex.js +16 -0
  512. package/.output/server/node_modules/mongoose/lib/helpers/isAsyncFunction.js +9 -0
  513. package/.output/server/node_modules/mongoose/lib/helpers/isBsonType.js +15 -0
  514. package/.output/server/node_modules/mongoose/lib/helpers/isMongooseObject.js +22 -0
  515. package/.output/server/node_modules/mongoose/lib/helpers/isObject.js +16 -0
  516. package/.output/server/node_modules/mongoose/lib/helpers/isPOJO.js +12 -0
  517. package/.output/server/node_modules/mongoose/lib/helpers/isPromise.js +6 -0
  518. package/.output/server/node_modules/mongoose/lib/helpers/isSimpleValidator.js +22 -0
  519. package/.output/server/node_modules/mongoose/lib/helpers/minimize.js +41 -0
  520. package/.output/server/node_modules/mongoose/lib/helpers/model/applyDefaultsToPOJO.js +52 -0
  521. package/.output/server/node_modules/mongoose/lib/helpers/model/applyHooks.js +150 -0
  522. package/.output/server/node_modules/mongoose/lib/helpers/model/applyMethods.js +70 -0
  523. package/.output/server/node_modules/mongoose/lib/helpers/model/applyStaticHooks.js +80 -0
  524. package/.output/server/node_modules/mongoose/lib/helpers/model/applyStatics.js +13 -0
  525. package/.output/server/node_modules/mongoose/lib/helpers/model/castBulkWrite.js +326 -0
  526. package/.output/server/node_modules/mongoose/lib/helpers/model/decorateBulkWriteResult.js +8 -0
  527. package/.output/server/node_modules/mongoose/lib/helpers/model/discriminator.js +265 -0
  528. package/.output/server/node_modules/mongoose/lib/helpers/model/pushNestedArrayPaths.js +15 -0
  529. package/.output/server/node_modules/mongoose/lib/helpers/omitUndefined.js +20 -0
  530. package/.output/server/node_modules/mongoose/lib/helpers/parallelLimit.js +55 -0
  531. package/.output/server/node_modules/mongoose/lib/helpers/path/parentPaths.js +18 -0
  532. package/.output/server/node_modules/mongoose/lib/helpers/path/setDottedPath.js +33 -0
  533. package/.output/server/node_modules/mongoose/lib/helpers/pluralize.js +95 -0
  534. package/.output/server/node_modules/mongoose/lib/helpers/populate/assignRawDocsToIdStructure.js +136 -0
  535. package/.output/server/node_modules/mongoose/lib/helpers/populate/assignVals.js +360 -0
  536. package/.output/server/node_modules/mongoose/lib/helpers/populate/createPopulateQueryFilter.js +97 -0
  537. package/.output/server/node_modules/mongoose/lib/helpers/populate/getModelsMapForPopulate.js +766 -0
  538. package/.output/server/node_modules/mongoose/lib/helpers/populate/getSchemaTypes.js +229 -0
  539. package/.output/server/node_modules/mongoose/lib/helpers/populate/getVirtual.js +103 -0
  540. package/.output/server/node_modules/mongoose/lib/helpers/populate/leanPopulateMap.js +7 -0
  541. package/.output/server/node_modules/mongoose/lib/helpers/populate/lookupLocalFields.js +40 -0
  542. package/.output/server/node_modules/mongoose/lib/helpers/populate/markArraySubdocsPopulated.js +49 -0
  543. package/.output/server/node_modules/mongoose/lib/helpers/populate/modelNamesFromRefPath.js +66 -0
  544. package/.output/server/node_modules/mongoose/lib/helpers/populate/removeDeselectedForeignField.js +31 -0
  545. package/.output/server/node_modules/mongoose/lib/helpers/populate/setPopulatedVirtualValue.js +33 -0
  546. package/.output/server/node_modules/mongoose/lib/helpers/populate/skipPopulateValue.js +10 -0
  547. package/.output/server/node_modules/mongoose/lib/helpers/populate/validateRef.js +19 -0
  548. package/.output/server/node_modules/mongoose/lib/helpers/printJestWarning.js +21 -0
  549. package/.output/server/node_modules/mongoose/lib/helpers/processConnectionOptions.js +65 -0
  550. package/.output/server/node_modules/mongoose/lib/helpers/projection/applyProjection.js +83 -0
  551. package/.output/server/node_modules/mongoose/lib/helpers/projection/hasIncludedChildren.js +41 -0
  552. package/.output/server/node_modules/mongoose/lib/helpers/projection/isDefiningProjection.js +18 -0
  553. package/.output/server/node_modules/mongoose/lib/helpers/projection/isExclusive.js +37 -0
  554. package/.output/server/node_modules/mongoose/lib/helpers/projection/isInclusive.js +39 -0
  555. package/.output/server/node_modules/mongoose/lib/helpers/projection/isNestedProjection.js +8 -0
  556. package/.output/server/node_modules/mongoose/lib/helpers/projection/isPathExcluded.js +40 -0
  557. package/.output/server/node_modules/mongoose/lib/helpers/projection/isPathSelectedInclusive.js +28 -0
  558. package/.output/server/node_modules/mongoose/lib/helpers/projection/isSubpath.js +14 -0
  559. package/.output/server/node_modules/mongoose/lib/helpers/projection/parseProjection.js +33 -0
  560. package/.output/server/node_modules/mongoose/lib/helpers/promiseOrCallback.js +54 -0
  561. package/.output/server/node_modules/mongoose/lib/helpers/query/applyGlobalOption.js +29 -0
  562. package/.output/server/node_modules/mongoose/lib/helpers/query/cast$expr.js +289 -0
  563. package/.output/server/node_modules/mongoose/lib/helpers/query/castFilterPath.js +54 -0
  564. package/.output/server/node_modules/mongoose/lib/helpers/query/castUpdate.js +641 -0
  565. package/.output/server/node_modules/mongoose/lib/helpers/query/getEmbeddedDiscriminatorPath.js +103 -0
  566. package/.output/server/node_modules/mongoose/lib/helpers/query/handleImmutable.js +44 -0
  567. package/.output/server/node_modules/mongoose/lib/helpers/query/handleReadPreferenceAliases.js +23 -0
  568. package/.output/server/node_modules/mongoose/lib/helpers/query/hasDollarKeys.js +23 -0
  569. package/.output/server/node_modules/mongoose/lib/helpers/query/isOperator.js +14 -0
  570. package/.output/server/node_modules/mongoose/lib/helpers/query/sanitizeFilter.js +41 -0
  571. package/.output/server/node_modules/mongoose/lib/helpers/query/sanitizeProjection.js +14 -0
  572. package/.output/server/node_modules/mongoose/lib/helpers/query/selectPopulatedFields.js +62 -0
  573. package/.output/server/node_modules/mongoose/lib/helpers/query/trusted.js +13 -0
  574. package/.output/server/node_modules/mongoose/lib/helpers/schema/addAutoId.js +7 -0
  575. package/.output/server/node_modules/mongoose/lib/helpers/schema/applyBuiltinPlugins.js +12 -0
  576. package/.output/server/node_modules/mongoose/lib/helpers/schema/applyPlugins.js +55 -0
  577. package/.output/server/node_modules/mongoose/lib/helpers/schema/applyReadConcern.js +20 -0
  578. package/.output/server/node_modules/mongoose/lib/helpers/schema/applyWriteConcern.js +37 -0
  579. package/.output/server/node_modules/mongoose/lib/helpers/schema/cleanPositionalOperators.js +12 -0
  580. package/.output/server/node_modules/mongoose/lib/helpers/schema/getIndexes.js +177 -0
  581. package/.output/server/node_modules/mongoose/lib/helpers/schema/getKeysInSchemaOrder.js +28 -0
  582. package/.output/server/node_modules/mongoose/lib/helpers/schema/getPath.js +43 -0
  583. package/.output/server/node_modules/mongoose/lib/helpers/schema/getSubdocumentStrictValue.js +32 -0
  584. package/.output/server/node_modules/mongoose/lib/helpers/schema/handleIdOption.js +20 -0
  585. package/.output/server/node_modules/mongoose/lib/helpers/schema/handleTimestampOption.js +24 -0
  586. package/.output/server/node_modules/mongoose/lib/helpers/schema/idGetter.js +34 -0
  587. package/.output/server/node_modules/mongoose/lib/helpers/schema/merge.js +36 -0
  588. package/.output/server/node_modules/mongoose/lib/helpers/schematype/handleImmutable.js +50 -0
  589. package/.output/server/node_modules/mongoose/lib/helpers/setDefaultsOnInsert.js +161 -0
  590. package/.output/server/node_modules/mongoose/lib/helpers/specialProperties.js +3 -0
  591. package/.output/server/node_modules/mongoose/lib/helpers/symbols.js +20 -0
  592. package/.output/server/node_modules/mongoose/lib/helpers/timers.js +3 -0
  593. package/.output/server/node_modules/mongoose/lib/helpers/timestamps/setDocumentTimestamps.js +26 -0
  594. package/.output/server/node_modules/mongoose/lib/helpers/timestamps/setupTimestamps.js +110 -0
  595. package/.output/server/node_modules/mongoose/lib/helpers/topology/allServersUnknown.js +12 -0
  596. package/.output/server/node_modules/mongoose/lib/helpers/topology/isAtlas.js +31 -0
  597. package/.output/server/node_modules/mongoose/lib/helpers/topology/isSSLError.js +16 -0
  598. package/.output/server/node_modules/mongoose/lib/helpers/update/applyTimestampsToChildren.js +193 -0
  599. package/.output/server/node_modules/mongoose/lib/helpers/update/applyTimestampsToUpdate.js +130 -0
  600. package/.output/server/node_modules/mongoose/lib/helpers/update/castArrayFilters.js +113 -0
  601. package/.output/server/node_modules/mongoose/lib/helpers/update/decorateUpdateWithVersionKey.js +35 -0
  602. package/.output/server/node_modules/mongoose/lib/helpers/update/modifiedPaths.js +33 -0
  603. package/.output/server/node_modules/mongoose/lib/helpers/update/moveImmutableProperties.js +53 -0
  604. package/.output/server/node_modules/mongoose/lib/helpers/update/removeUnusedArrayFilters.js +32 -0
  605. package/.output/server/node_modules/mongoose/lib/helpers/update/updatedPathsByArrayFilter.js +27 -0
  606. package/.output/server/node_modules/mongoose/lib/helpers/updateValidators.js +247 -0
  607. package/.output/server/node_modules/mongoose/lib/index.js +17 -0
  608. package/.output/server/node_modules/mongoose/lib/internal.js +46 -0
  609. package/.output/server/node_modules/mongoose/lib/model.js +5208 -0
  610. package/.output/server/node_modules/mongoose/lib/modifiedPathsSnapshot.js +9 -0
  611. package/.output/server/node_modules/mongoose/lib/mongoose.js +1383 -0
  612. package/.output/server/node_modules/mongoose/lib/options/populateOptions.js +36 -0
  613. package/.output/server/node_modules/mongoose/lib/options/propertyOptions.js +8 -0
  614. package/.output/server/node_modules/mongoose/lib/options/saveOptions.js +16 -0
  615. package/.output/server/node_modules/mongoose/lib/options/schemaArrayOptions.js +78 -0
  616. package/.output/server/node_modules/mongoose/lib/options/schemaBufferOptions.js +38 -0
  617. package/.output/server/node_modules/mongoose/lib/options/schemaDateOptions.js +71 -0
  618. package/.output/server/node_modules/mongoose/lib/options/schemaDocumentArrayOptions.js +68 -0
  619. package/.output/server/node_modules/mongoose/lib/options/schemaMapOptions.js +43 -0
  620. package/.output/server/node_modules/mongoose/lib/options/schemaNumberOptions.js +101 -0
  621. package/.output/server/node_modules/mongoose/lib/options/schemaObjectIdOptions.js +64 -0
  622. package/.output/server/node_modules/mongoose/lib/options/schemaStringOptions.js +138 -0
  623. package/.output/server/node_modules/mongoose/lib/options/schemaSubdocumentOptions.js +66 -0
  624. package/.output/server/node_modules/mongoose/lib/options/schemaTypeOptions.js +244 -0
  625. package/.output/server/node_modules/mongoose/lib/options/schemaUnionOptions.js +32 -0
  626. package/.output/server/node_modules/mongoose/lib/options/virtualOptions.js +164 -0
  627. package/.output/server/node_modules/mongoose/lib/options.js +18 -0
  628. package/.output/server/node_modules/mongoose/lib/plugins/index.js +6 -0
  629. package/.output/server/node_modules/mongoose/lib/plugins/saveSubdocs.js +102 -0
  630. package/.output/server/node_modules/mongoose/lib/plugins/sharding.js +83 -0
  631. package/.output/server/node_modules/mongoose/lib/plugins/trackTransaction.js +85 -0
  632. package/.output/server/node_modules/mongoose/lib/plugins/validateBeforeSave.js +51 -0
  633. package/.output/server/node_modules/mongoose/lib/query.js +5693 -0
  634. package/.output/server/node_modules/mongoose/lib/queryHelpers.js +394 -0
  635. package/.output/server/node_modules/mongoose/lib/schema/array.js +744 -0
  636. package/.output/server/node_modules/mongoose/lib/schema/bigint.js +282 -0
  637. package/.output/server/node_modules/mongoose/lib/schema/boolean.js +332 -0
  638. package/.output/server/node_modules/mongoose/lib/schema/buffer.js +343 -0
  639. package/.output/server/node_modules/mongoose/lib/schema/date.js +467 -0
  640. package/.output/server/node_modules/mongoose/lib/schema/decimal128.js +263 -0
  641. package/.output/server/node_modules/mongoose/lib/schema/documentArray.js +701 -0
  642. package/.output/server/node_modules/mongoose/lib/schema/documentArrayElement.js +102 -0
  643. package/.output/server/node_modules/mongoose/lib/schema/double.js +246 -0
  644. package/.output/server/node_modules/mongoose/lib/schema/index.js +31 -0
  645. package/.output/server/node_modules/mongoose/lib/schema/int32.js +289 -0
  646. package/.output/server/node_modules/mongoose/lib/schema/map.js +201 -0
  647. package/.output/server/node_modules/mongoose/lib/schema/mixed.js +146 -0
  648. package/.output/server/node_modules/mongoose/lib/schema/number.js +498 -0
  649. package/.output/server/node_modules/mongoose/lib/schema/objectId.js +333 -0
  650. package/.output/server/node_modules/mongoose/lib/schema/operators/bitwise.js +38 -0
  651. package/.output/server/node_modules/mongoose/lib/schema/operators/exists.js +12 -0
  652. package/.output/server/node_modules/mongoose/lib/schema/operators/geospatial.js +107 -0
  653. package/.output/server/node_modules/mongoose/lib/schema/operators/helpers.js +32 -0
  654. package/.output/server/node_modules/mongoose/lib/schema/operators/text.js +39 -0
  655. package/.output/server/node_modules/mongoose/lib/schema/operators/type.js +20 -0
  656. package/.output/server/node_modules/mongoose/lib/schema/string.js +733 -0
  657. package/.output/server/node_modules/mongoose/lib/schema/subdocument.js +445 -0
  658. package/.output/server/node_modules/mongoose/lib/schema/symbols.js +5 -0
  659. package/.output/server/node_modules/mongoose/lib/schema/union.js +113 -0
  660. package/.output/server/node_modules/mongoose/lib/schema/uuid.js +326 -0
  661. package/.output/server/node_modules/mongoose/lib/schema.js +3185 -0
  662. package/.output/server/node_modules/mongoose/lib/schemaType.js +1853 -0
  663. package/.output/server/node_modules/mongoose/lib/stateMachine.js +232 -0
  664. package/.output/server/node_modules/mongoose/lib/types/array/index.js +119 -0
  665. package/.output/server/node_modules/mongoose/lib/types/array/isMongooseArray.js +5 -0
  666. package/.output/server/node_modules/mongoose/lib/types/array/methods/index.js +1096 -0
  667. package/.output/server/node_modules/mongoose/lib/types/arraySubdocument.js +208 -0
  668. package/.output/server/node_modules/mongoose/lib/types/buffer.js +294 -0
  669. package/.output/server/node_modules/mongoose/lib/types/decimal128.js +13 -0
  670. package/.output/server/node_modules/mongoose/lib/types/documentArray/index.js +113 -0
  671. package/.output/server/node_modules/mongoose/lib/types/documentArray/isMongooseDocumentArray.js +5 -0
  672. package/.output/server/node_modules/mongoose/lib/types/documentArray/methods/index.js +413 -0
  673. package/.output/server/node_modules/mongoose/lib/types/double.js +13 -0
  674. package/.output/server/node_modules/mongoose/lib/types/index.js +23 -0
  675. package/.output/server/node_modules/mongoose/lib/types/map.js +419 -0
  676. package/.output/server/node_modules/mongoose/lib/types/objectid.js +41 -0
  677. package/.output/server/node_modules/mongoose/lib/types/subdocument.js +492 -0
  678. package/.output/server/node_modules/mongoose/lib/types/uuid.js +13 -0
  679. package/.output/server/node_modules/mongoose/lib/utils.js +1043 -0
  680. package/.output/server/node_modules/mongoose/lib/validOptions.js +42 -0
  681. package/.output/server/node_modules/mongoose/lib/virtualType.js +204 -0
  682. package/.output/server/node_modules/mongoose/package.json +156 -0
  683. package/.output/server/node_modules/mpath/index.js +3 -0
  684. package/.output/server/node_modules/mpath/lib/index.js +336 -0
  685. package/.output/server/node_modules/mpath/lib/stringToParts.js +48 -0
  686. package/.output/server/node_modules/mpath/package.json +144 -0
  687. package/.output/server/node_modules/mquery/lib/collection/collection.js +45 -0
  688. package/.output/server/node_modules/mquery/lib/collection/index.js +13 -0
  689. package/.output/server/node_modules/mquery/lib/collection/node.js +114 -0
  690. package/.output/server/node_modules/mquery/lib/env.js +22 -0
  691. package/.output/server/node_modules/mquery/lib/mquery.js +2705 -0
  692. package/.output/server/node_modules/mquery/lib/permissions.js +78 -0
  693. package/.output/server/node_modules/mquery/lib/utils.js +297 -0
  694. package/.output/server/node_modules/mquery/package.json +38 -0
  695. package/.output/server/node_modules/ms/index.js +162 -0
  696. package/.output/server/node_modules/ms/package.json +38 -0
  697. package/.output/server/node_modules/punycode/package.json +58 -0
  698. package/.output/server/node_modules/punycode/punycode.js +443 -0
  699. package/.output/server/node_modules/sift/index.js +4 -0
  700. package/.output/server/node_modules/sift/lib/index.js +781 -0
  701. package/.output/server/node_modules/sift/package.json +61 -0
  702. package/.output/server/node_modules/smart-buffer/build/smartbuffer.js +1233 -0
  703. package/.output/server/node_modules/smart-buffer/build/utils.js +108 -0
  704. package/.output/server/node_modules/smart-buffer/package.json +81 -0
  705. package/.output/server/node_modules/socks/build/client/socksclient.js +793 -0
  706. package/.output/server/node_modules/socks/build/common/constants.js +108 -0
  707. package/.output/server/node_modules/socks/build/common/helpers.js +167 -0
  708. package/.output/server/node_modules/socks/build/common/receivebuffer.js +43 -0
  709. package/.output/server/node_modules/socks/build/common/util.js +25 -0
  710. package/.output/server/node_modules/socks/build/index.js +18 -0
  711. package/.output/server/node_modules/socks/package.json +58 -0
  712. package/.output/server/node_modules/source-map-js/lib/array-set.js +121 -0
  713. package/.output/server/node_modules/source-map-js/lib/base64-vlq.js +140 -0
  714. package/.output/server/node_modules/source-map-js/lib/base64.js +67 -0
  715. package/.output/server/node_modules/source-map-js/lib/binary-search.js +111 -0
  716. package/.output/server/node_modules/source-map-js/lib/mapping-list.js +79 -0
  717. package/.output/server/node_modules/source-map-js/lib/quick-sort.js +132 -0
  718. package/.output/server/node_modules/source-map-js/lib/source-map-consumer.js +1188 -0
  719. package/.output/server/node_modules/source-map-js/lib/source-map-generator.js +444 -0
  720. package/.output/server/node_modules/source-map-js/lib/source-node.js +413 -0
  721. package/.output/server/node_modules/source-map-js/lib/util.js +594 -0
  722. package/.output/server/node_modules/source-map-js/package.json +71 -0
  723. package/.output/server/node_modules/source-map-js/source-map.js +8 -0
  724. package/.output/server/node_modules/sparse-bitfield/index.js +95 -0
  725. package/.output/server/node_modules/sparse-bitfield/package.json +27 -0
  726. package/.output/server/node_modules/supports-color/index.js +202 -0
  727. package/.output/server/node_modules/supports-color/package.json +64 -0
  728. package/.output/server/node_modules/tailwindcss/dist/chunk-X4GG3EDV.mjs +1 -0
  729. package/.output/server/node_modules/tailwindcss/dist/colors.mjs +1 -0
  730. package/.output/server/node_modules/tailwindcss/package.json +89 -0
  731. package/.output/server/node_modules/tr46/index.js +344 -0
  732. package/.output/server/node_modules/tr46/lib/mappingTable.json +1 -0
  733. package/.output/server/node_modules/tr46/lib/regexes.js +29 -0
  734. package/.output/server/node_modules/tr46/lib/statusMapping.js +9 -0
  735. package/.output/server/node_modules/tr46/package.json +44 -0
  736. package/.output/server/node_modules/ufo/dist/index.mjs +645 -0
  737. package/.output/server/node_modules/ufo/package.json +48 -0
  738. package/.output/server/node_modules/unhead/dist/index.mjs +9 -0
  739. package/.output/server/node_modules/unhead/dist/parser.mjs +508 -0
  740. package/.output/server/node_modules/unhead/dist/plugins.mjs +101 -0
  741. package/.output/server/node_modules/unhead/dist/scripts.mjs +30 -0
  742. package/.output/server/node_modules/unhead/dist/server.mjs +180 -0
  743. package/.output/server/node_modules/unhead/dist/shared/unhead.0eF0fa-Y.mjs +236 -0
  744. package/.output/server/node_modules/unhead/dist/shared/unhead.B5FWS6X0.mjs +207 -0
  745. package/.output/server/node_modules/unhead/dist/shared/unhead.BYvz9V1x.mjs +43 -0
  746. package/.output/server/node_modules/unhead/dist/shared/unhead.BnoAbrHA.mjs +269 -0
  747. package/.output/server/node_modules/unhead/dist/shared/unhead.CbpEuj3y.mjs +71 -0
  748. package/.output/server/node_modules/unhead/dist/shared/unhead.Chhckluj.mjs +166 -0
  749. package/.output/server/node_modules/unhead/dist/shared/unhead.Ct24BOby.mjs +182 -0
  750. package/.output/server/node_modules/unhead/dist/shared/unhead.DQc16pHI.mjs +196 -0
  751. package/.output/server/node_modules/unhead/dist/shared/unhead._ybhDo-G.mjs +44 -0
  752. package/.output/server/node_modules/unhead/dist/shared/unhead.yem5I2v_.mjs +38 -0
  753. package/.output/server/node_modules/unhead/dist/utils.mjs +5 -0
  754. package/.output/server/node_modules/unhead/package.json +105 -0
  755. package/.output/server/node_modules/vue/dist/vue.cjs.js +80 -0
  756. package/.output/server/node_modules/vue/dist/vue.cjs.prod.js +66 -0
  757. package/.output/server/node_modules/vue/index.js +7 -0
  758. package/.output/server/node_modules/vue/index.mjs +1 -0
  759. package/.output/server/node_modules/vue/package.json +112 -0
  760. package/.output/server/node_modules/vue/server-renderer/index.mjs +1 -0
  761. package/.output/server/node_modules/vue-bundle-renderer/dist/runtime.mjs +301 -0
  762. package/.output/server/node_modules/vue-bundle-renderer/package.json +55 -0
  763. package/.output/server/node_modules/webidl-conversions/lib/index.js +450 -0
  764. package/.output/server/node_modules/webidl-conversions/package.json +35 -0
  765. package/.output/server/node_modules/whatwg-url/index.js +27 -0
  766. package/.output/server/node_modules/whatwg-url/lib/Function.js +42 -0
  767. package/.output/server/node_modules/whatwg-url/lib/URL-impl.js +233 -0
  768. package/.output/server/node_modules/whatwg-url/lib/URL.js +499 -0
  769. package/.output/server/node_modules/whatwg-url/lib/URLSearchParams-impl.js +135 -0
  770. package/.output/server/node_modules/whatwg-url/lib/URLSearchParams.js +505 -0
  771. package/.output/server/node_modules/whatwg-url/lib/encoding.js +16 -0
  772. package/.output/server/node_modules/whatwg-url/lib/infra.js +26 -0
  773. package/.output/server/node_modules/whatwg-url/lib/percent-encoding.js +142 -0
  774. package/.output/server/node_modules/whatwg-url/lib/url-state-machine.js +1274 -0
  775. package/.output/server/node_modules/whatwg-url/lib/urlencoded.js +89 -0
  776. package/.output/server/node_modules/whatwg-url/lib/utils.js +190 -0
  777. package/.output/server/node_modules/whatwg-url/package.json +53 -0
  778. package/.output/server/node_modules/whatwg-url/webidl2js-wrapper.js +7 -0
  779. package/.output/server/node_modules/zod/index.js +4 -0
  780. package/.output/server/node_modules/zod/package.json +135 -0
  781. package/.output/server/node_modules/zod/v4/classic/checks.js +1 -0
  782. package/.output/server/node_modules/zod/v4/classic/coerce.js +17 -0
  783. package/.output/server/node_modules/zod/v4/classic/compat.js +31 -0
  784. package/.output/server/node_modules/zod/v4/classic/errors.js +48 -0
  785. package/.output/server/node_modules/zod/v4/classic/external.js +20 -0
  786. package/.output/server/node_modules/zod/v4/classic/from-json-schema.js +584 -0
  787. package/.output/server/node_modules/zod/v4/classic/index.js +4 -0
  788. package/.output/server/node_modules/zod/v4/classic/iso.js +30 -0
  789. package/.output/server/node_modules/zod/v4/classic/package.json +6 -0
  790. package/.output/server/node_modules/zod/v4/classic/parse.js +15 -0
  791. package/.output/server/node_modules/zod/v4/classic/schemas.js +1157 -0
  792. package/.output/server/node_modules/zod/v4/core/api.js +1082 -0
  793. package/.output/server/node_modules/zod/v4/core/checks.js +575 -0
  794. package/.output/server/node_modules/zod/v4/core/core.js +76 -0
  795. package/.output/server/node_modules/zod/v4/core/doc.js +35 -0
  796. package/.output/server/node_modules/zod/v4/core/errors.js +182 -0
  797. package/.output/server/node_modules/zod/v4/core/index.js +16 -0
  798. package/.output/server/node_modules/zod/v4/core/json-schema-generator.js +95 -0
  799. package/.output/server/node_modules/zod/v4/core/json-schema-processors.js +605 -0
  800. package/.output/server/node_modules/zod/v4/core/json-schema.js +1 -0
  801. package/.output/server/node_modules/zod/v4/core/package.json +6 -0
  802. package/.output/server/node_modules/zod/v4/core/parse.js +93 -0
  803. package/.output/server/node_modules/zod/v4/core/regexes.js +133 -0
  804. package/.output/server/node_modules/zod/v4/core/registries.js +51 -0
  805. package/.output/server/node_modules/zod/v4/core/schemas.js +2093 -0
  806. package/.output/server/node_modules/zod/v4/core/to-json-schema.js +437 -0
  807. package/.output/server/node_modules/zod/v4/core/util.js +651 -0
  808. package/.output/server/node_modules/zod/v4/core/versions.js +5 -0
  809. package/.output/server/node_modules/zod/v4/index.js +3 -0
  810. package/.output/server/node_modules/zod/v4/locales/ar.js +106 -0
  811. package/.output/server/node_modules/zod/v4/locales/az.js +105 -0
  812. package/.output/server/node_modules/zod/v4/locales/be.js +156 -0
  813. package/.output/server/node_modules/zod/v4/locales/bg.js +120 -0
  814. package/.output/server/node_modules/zod/v4/locales/ca.js +107 -0
  815. package/.output/server/node_modules/zod/v4/locales/cs.js +111 -0
  816. package/.output/server/node_modules/zod/v4/locales/da.js +115 -0
  817. package/.output/server/node_modules/zod/v4/locales/de.js +108 -0
  818. package/.output/server/node_modules/zod/v4/locales/en.js +109 -0
  819. package/.output/server/node_modules/zod/v4/locales/eo.js +109 -0
  820. package/.output/server/node_modules/zod/v4/locales/es.js +132 -0
  821. package/.output/server/node_modules/zod/v4/locales/fa.js +114 -0
  822. package/.output/server/node_modules/zod/v4/locales/fi.js +112 -0
  823. package/.output/server/node_modules/zod/v4/locales/fr-CA.js +107 -0
  824. package/.output/server/node_modules/zod/v4/locales/fr.js +108 -0
  825. package/.output/server/node_modules/zod/v4/locales/he.js +214 -0
  826. package/.output/server/node_modules/zod/v4/locales/hu.js +108 -0
  827. package/.output/server/node_modules/zod/v4/locales/hy.js +147 -0
  828. package/.output/server/node_modules/zod/v4/locales/id.js +106 -0
  829. package/.output/server/node_modules/zod/v4/locales/index.js +49 -0
  830. package/.output/server/node_modules/zod/v4/locales/is.js +109 -0
  831. package/.output/server/node_modules/zod/v4/locales/it.js +108 -0
  832. package/.output/server/node_modules/zod/v4/locales/ja.js +107 -0
  833. package/.output/server/node_modules/zod/v4/locales/ka.js +112 -0
  834. package/.output/server/node_modules/zod/v4/locales/kh.js +5 -0
  835. package/.output/server/node_modules/zod/v4/locales/km.js +110 -0
  836. package/.output/server/node_modules/zod/v4/locales/ko.js +111 -0
  837. package/.output/server/node_modules/zod/v4/locales/lt.js +203 -0
  838. package/.output/server/node_modules/zod/v4/locales/mk.js +109 -0
  839. package/.output/server/node_modules/zod/v4/locales/ms.js +107 -0
  840. package/.output/server/node_modules/zod/v4/locales/nl.js +110 -0
  841. package/.output/server/node_modules/zod/v4/locales/no.js +108 -0
  842. package/.output/server/node_modules/zod/v4/locales/ota.js +109 -0
  843. package/.output/server/node_modules/zod/v4/locales/package.json +6 -0
  844. package/.output/server/node_modules/zod/v4/locales/pl.js +109 -0
  845. package/.output/server/node_modules/zod/v4/locales/ps.js +114 -0
  846. package/.output/server/node_modules/zod/v4/locales/pt.js +108 -0
  847. package/.output/server/node_modules/zod/v4/locales/ru.js +156 -0
  848. package/.output/server/node_modules/zod/v4/locales/sl.js +109 -0
  849. package/.output/server/node_modules/zod/v4/locales/sv.js +110 -0
  850. package/.output/server/node_modules/zod/v4/locales/ta.js +110 -0
  851. package/.output/server/node_modules/zod/v4/locales/th.js +110 -0
  852. package/.output/server/node_modules/zod/v4/locales/tr.js +105 -0
  853. package/.output/server/node_modules/zod/v4/locales/ua.js +5 -0
  854. package/.output/server/node_modules/zod/v4/locales/uk.js +108 -0
  855. package/.output/server/node_modules/zod/v4/locales/ur.js +110 -0
  856. package/.output/server/node_modules/zod/v4/locales/uz.js +109 -0
  857. package/.output/server/node_modules/zod/v4/locales/vi.js +108 -0
  858. package/.output/server/node_modules/zod/v4/locales/yo.js +107 -0
  859. package/.output/server/node_modules/zod/v4/locales/zh-CN.js +109 -0
  860. package/.output/server/node_modules/zod/v4/locales/zh-TW.js +107 -0
  861. package/.output/server/node_modules/zod/v4/package.json +6 -0
  862. package/.output/server/package.json +53 -0
  863. package/README.md +131 -0
  864. package/app/app.vue +7 -0
  865. package/app/assets/css/main.css +2 -0
  866. package/app/components/StudioEditor.vue +114 -0
  867. package/app/components/StudioOutput.vue +43 -0
  868. package/app/components/ZodMongooseStudio.vue +121 -0
  869. package/app/pages/index.vue +3 -0
  870. package/app/plugins/monaco.client.ts +14 -0
  871. package/bin/index.mjs +69 -0
  872. package/nuxt.config.ts +18 -0
  873. package/package.json +49 -0
  874. package/server/api/parse.post.ts +90 -0
  875. package/server/api/resolve.get.ts +38 -0
  876. package/server/middleware/security.ts +40 -0
@@ -0,0 +1,1853 @@
1
+ 'use strict';
2
+
3
+ /*!
4
+ * Module dependencies.
5
+ */
6
+
7
+ const MongooseError = require('./error/index');
8
+ const SchemaTypeOptions = require('./options/schemaTypeOptions');
9
+ const $exists = require('./schema/operators/exists');
10
+ const $type = require('./schema/operators/type');
11
+ const clone = require('./helpers/clone');
12
+ const handleImmutable = require('./helpers/schematype/handleImmutable');
13
+ const isAsyncFunction = require('./helpers/isAsyncFunction');
14
+ const isSimpleValidator = require('./helpers/isSimpleValidator');
15
+ const immediate = require('./helpers/immediate');
16
+ const schemaTypeSymbol = require('./helpers/symbols').schemaTypeSymbol;
17
+ const utils = require('./utils');
18
+ const validatorErrorSymbol = require('./helpers/symbols').validatorErrorSymbol;
19
+ const documentIsModified = require('./helpers/symbols').documentIsModified;
20
+
21
+ const populateModelSymbol = require('./helpers/symbols').populateModelSymbol;
22
+
23
+ const CastError = MongooseError.CastError;
24
+ const ValidatorError = MongooseError.ValidatorError;
25
+
26
+ const setOptionsForDefaults = { _skipMarkModified: true };
27
+
28
+ /**
29
+ * SchemaType constructor. Do **not** instantiate `SchemaType` directly.
30
+ * Mongoose converts your schema paths into SchemaTypes automatically.
31
+ *
32
+ * #### Example:
33
+ *
34
+ * const schema = new Schema({ name: String });
35
+ * schema.path('name') instanceof SchemaType; // true
36
+ *
37
+ * @param {String} path
38
+ * @param {SchemaTypeOptions} [options] See [SchemaTypeOptions docs](https://mongoosejs.com/docs/api/schematypeoptions.html)
39
+ * @param {String} [instance]
40
+ * @param {Schema} [parentSchema]
41
+ * @api public
42
+ */
43
+
44
+ function SchemaType(path, options, instance, parentSchema) {
45
+ this[schemaTypeSymbol] = true;
46
+ this.path = path;
47
+ this.instance = instance;
48
+ this.schemaName = this.constructor.schemaName;
49
+ this.validators = [];
50
+ this.getters = Object.hasOwn(this.constructor, 'getters') ?
51
+ this.constructor.getters.slice() :
52
+ [];
53
+ this.setters = Object.hasOwn(this.constructor, 'setters') ?
54
+ this.constructor.setters.slice() :
55
+ [];
56
+
57
+ this.splitPath();
58
+
59
+ options = options || {};
60
+ const defaultOptions = this.constructor.defaultOptions || {};
61
+ const defaultOptionsKeys = Object.keys(defaultOptions);
62
+
63
+ for (const option of defaultOptionsKeys) {
64
+ if (option === 'validate') {
65
+ this.validate(defaultOptions.validate);
66
+ } else if (Object.hasOwn(defaultOptions, option) && !Object.hasOwn(options, option)) {
67
+ options[option] = defaultOptions[option];
68
+ }
69
+ }
70
+
71
+ if (options.select == null) {
72
+ delete options.select;
73
+ }
74
+
75
+ const Options = this.OptionsConstructor || SchemaTypeOptions;
76
+ this.options = new Options(options);
77
+ this.parentSchema = parentSchema;
78
+ this._index = null;
79
+
80
+ if (utils.hasUserDefinedProperty(this.options, 'immutable')) {
81
+ this.$immutable = this.options.immutable;
82
+
83
+ handleImmutable(this);
84
+ }
85
+
86
+ const keys = Object.keys(this.options);
87
+ for (const prop of keys) {
88
+ if (prop === 'cast') {
89
+ if (Array.isArray(this.options[prop])) {
90
+ this.castFunction.apply(this, this.options[prop]);
91
+ } else {
92
+ this.castFunction(this.options[prop]);
93
+ }
94
+ continue;
95
+ }
96
+ if (utils.hasUserDefinedProperty(this.options, prop) && typeof this[prop] === 'function') {
97
+ // { unique: true, index: true }
98
+ if (prop === 'index' && this._index) {
99
+ if (options.index === false) {
100
+ const index = this._index;
101
+ if (typeof index === 'object' && index != null) {
102
+ if (index.unique) {
103
+ throw new Error('Path "' + this.path + '" may not have `index` ' +
104
+ 'set to false and `unique` set to true');
105
+ }
106
+ if (index.sparse) {
107
+ throw new Error('Path "' + this.path + '" may not have `index` ' +
108
+ 'set to false and `sparse` set to true');
109
+ }
110
+ }
111
+
112
+ this._index = false;
113
+ }
114
+ continue;
115
+ }
116
+
117
+ const val = options[prop];
118
+ // Special case so we don't screw up array defaults, see gh-5780
119
+ if (prop === 'default') {
120
+ this.default(val);
121
+ continue;
122
+ }
123
+
124
+ const opts = Array.isArray(val) ? val : [val];
125
+
126
+ this[prop].apply(this, opts);
127
+ }
128
+ }
129
+
130
+ Object.defineProperty(this, '$$context', {
131
+ enumerable: false,
132
+ configurable: false,
133
+ writable: true,
134
+ value: null
135
+ });
136
+ }
137
+
138
+ /**
139
+ * The class that Mongoose uses internally to instantiate this SchemaType's `options` property.
140
+ * @memberOf SchemaType
141
+ * @instance
142
+ * @api private
143
+ */
144
+
145
+ SchemaType.prototype.OptionsConstructor = SchemaTypeOptions;
146
+
147
+ /**
148
+ * The path to this SchemaType in a Schema.
149
+ *
150
+ * #### Example:
151
+ *
152
+ * const schema = new Schema({ name: String });
153
+ * schema.path('name').path; // 'name'
154
+ *
155
+ * @property path
156
+ * @api public
157
+ * @memberOf SchemaType
158
+ */
159
+
160
+ SchemaType.prototype.path;
161
+
162
+ /**
163
+ * Returns a plain JavaScript object representing this SchemaType.
164
+ *
165
+ * Typically used by `JSON.stringify()` or when calling `.toJSON()` on a SchemaType instance.
166
+ * Omits certain internal properties such as `parentSchema` that can cause circular references.
167
+ *
168
+ * #### Example:
169
+ *
170
+ * const schema = new Schema({ name: String });
171
+ * const schematype = schema.path('name');
172
+ * console.log(schematype.toJSON());
173
+ *
174
+ * @function toJSON
175
+ * @memberOf SchemaType
176
+ * @instance
177
+ * @api public
178
+ */
179
+
180
+ SchemaType.prototype.toJSON = function toJSON() {
181
+ const res = { ...this };
182
+ delete res.parentSchema;
183
+ return res;
184
+ };
185
+
186
+ /**
187
+ * The validators that Mongoose should run to validate properties at this SchemaType's path.
188
+ *
189
+ * #### Example:
190
+ *
191
+ * const schema = new Schema({ name: { type: String, required: true } });
192
+ * schema.path('name').validators.length; // 1, the `required` validator
193
+ *
194
+ * @property validators
195
+ * @api public
196
+ * @memberOf SchemaType
197
+ */
198
+
199
+ SchemaType.prototype.validators;
200
+
201
+ /**
202
+ * True if this SchemaType has a required validator. False otherwise.
203
+ *
204
+ * #### Example:
205
+ *
206
+ * const schema = new Schema({ name: { type: String, required: true } });
207
+ * schema.path('name').isRequired; // true
208
+ *
209
+ * schema.path('name').required(false);
210
+ * schema.path('name').isRequired; // false
211
+ *
212
+ * @property isRequired
213
+ * @api public
214
+ * @memberOf SchemaType
215
+ */
216
+
217
+ SchemaType.prototype.isRequired;
218
+
219
+ /**
220
+ * Split the current dottet path into segments
221
+ *
222
+ * @return {String[]|undefined}
223
+ * @api private
224
+ */
225
+
226
+ SchemaType.prototype.splitPath = function() {
227
+ if (this._presplitPath != null) {
228
+ return this._presplitPath;
229
+ }
230
+ if (this.path == null) {
231
+ return undefined;
232
+ }
233
+
234
+ this._presplitPath = this.path.indexOf('.') === -1 ? [this.path] : this.path.split('.');
235
+ return this._presplitPath;
236
+ };
237
+
238
+ /**
239
+ * Get/set the function used to cast arbitrary values to this type.
240
+ *
241
+ * #### Example:
242
+ *
243
+ * // Disallow `null` for numbers, and don't try to cast any values to
244
+ * // numbers, so even strings like '123' will cause a CastError.
245
+ * mongoose.Number.cast(function(v) {
246
+ * assert.ok(v === undefined || typeof v === 'number');
247
+ * return v;
248
+ * });
249
+ *
250
+ * @param {Function|false} caster Function that casts arbitrary values to this type, or throws an error if casting failed
251
+ * @return {Function}
252
+ * @static
253
+ * @memberOf SchemaType
254
+ * @function cast
255
+ * @api public
256
+ */
257
+
258
+ SchemaType.cast = function cast(caster) {
259
+ if (arguments.length === 0) {
260
+ return this._cast;
261
+ }
262
+ if (caster === false) {
263
+ caster = v => v;
264
+ }
265
+ this._cast = caster;
266
+
267
+ return this._cast;
268
+ };
269
+
270
+ /**
271
+ * Get/set the function used to cast arbitrary values to this particular schematype instance.
272
+ * Overrides `SchemaType.cast()`.
273
+ *
274
+ * #### Example:
275
+ *
276
+ * // Disallow `null` for numbers, and don't try to cast any values to
277
+ * // numbers, so even strings like '123' will cause a CastError.
278
+ * const number = new mongoose.Number('mypath', {});
279
+ * number.cast(function(v) {
280
+ * assert.ok(v === undefined || typeof v === 'number');
281
+ * return v;
282
+ * });
283
+ *
284
+ * @param {Function|false} caster Function that casts arbitrary values to this type, or throws an error if casting failed
285
+ * @return {Function}
286
+ * @memberOf SchemaType
287
+ * @api public
288
+ */
289
+
290
+ SchemaType.prototype.castFunction = function castFunction(caster, message) {
291
+ if (arguments.length === 0) {
292
+ return this._castFunction;
293
+ }
294
+
295
+ if (caster === false) {
296
+ caster = this.constructor._defaultCaster || (v => v);
297
+ }
298
+ if (typeof caster === 'string') {
299
+ this._castErrorMessage = caster;
300
+ return this._castFunction;
301
+ }
302
+ if (caster != null) {
303
+ this._castFunction = caster;
304
+ }
305
+ if (message != null) {
306
+ this._castErrorMessage = message;
307
+ }
308
+
309
+ return this._castFunction;
310
+ };
311
+
312
+ /**
313
+ * The function that Mongoose calls to cast arbitrary values to this SchemaType.
314
+ *
315
+ * @param {Object} value value to cast
316
+ * @param {Document} doc document that triggers the casting
317
+ * @param {Boolean} init
318
+ * @api public
319
+ */
320
+
321
+ SchemaType.prototype.cast = function cast() {
322
+ throw new Error('Base SchemaType class does not implement a `cast()` function');
323
+ };
324
+
325
+ /**
326
+ * Sets a default option for this schema type.
327
+ *
328
+ * #### Example:
329
+ *
330
+ * // Make all strings be trimmed by default
331
+ * mongoose.SchemaTypes.String.set('trim', true);
332
+ *
333
+ * @param {String} option The name of the option you'd like to set (e.g. trim, lowercase, etc...)
334
+ * @param {Any} value The value of the option you'd like to set.
335
+ * @return {void}
336
+ * @static
337
+ * @memberOf SchemaType
338
+ * @function set
339
+ * @api public
340
+ */
341
+
342
+ SchemaType.set = function set(option, value) {
343
+ if (!Object.hasOwn(this, 'defaultOptions')) {
344
+ this.defaultOptions = Object.assign({}, this.defaultOptions);
345
+ }
346
+ this.defaultOptions[option] = value;
347
+ };
348
+
349
+ /**
350
+ * Attaches a getter for all instances of this schema type.
351
+ *
352
+ * #### Example:
353
+ *
354
+ * // Make all numbers round down
355
+ * mongoose.Number.get(function(v) { return Math.floor(v); });
356
+ *
357
+ * @param {Function} getter
358
+ * @return {this}
359
+ * @static
360
+ * @memberOf SchemaType
361
+ * @function get
362
+ * @api public
363
+ */
364
+
365
+ SchemaType.get = function(getter) {
366
+ this.getters = Object.hasOwn(this, 'getters') ? this.getters : [];
367
+ this.getters.push(getter);
368
+ };
369
+
370
+ /**
371
+ * Sets a default value for this SchemaType.
372
+ *
373
+ * #### Example:
374
+ *
375
+ * const schema = new Schema({ n: { type: Number, default: 10 })
376
+ * const M = db.model('M', schema)
377
+ * const m = new M;
378
+ * console.log(m.n) // 10
379
+ *
380
+ * Defaults can be either `functions` which return the value to use as the default or the literal value itself. Either way, the value will be cast based on its schema type before being set during document creation.
381
+ *
382
+ * #### Example:
383
+ *
384
+ * // values are cast:
385
+ * const schema = new Schema({ aNumber: { type: Number, default: 4.815162342 }})
386
+ * const M = db.model('M', schema)
387
+ * const m = new M;
388
+ * console.log(m.aNumber) // 4.815162342
389
+ *
390
+ * // default unique objects for Mixed types:
391
+ * const schema = new Schema({ mixed: Schema.Types.Mixed });
392
+ * schema.path('mixed').default(function () {
393
+ * return {};
394
+ * });
395
+ *
396
+ * // if we don't use a function to return object literals for Mixed defaults,
397
+ * // each document will receive a reference to the same object literal creating
398
+ * // a "shared" object instance:
399
+ * const schema = new Schema({ mixed: Schema.Types.Mixed });
400
+ * schema.path('mixed').default({});
401
+ * const M = db.model('M', schema);
402
+ * const m1 = new M;
403
+ * m1.mixed.added = 1;
404
+ * console.log(m1.mixed); // { added: 1 }
405
+ * const m2 = new M;
406
+ * console.log(m2.mixed); // { added: 1 }
407
+ *
408
+ * @param {Function|any} val The default value to set
409
+ * @return {Any|undefined} Returns the set default value.
410
+ * @api public
411
+ */
412
+
413
+ SchemaType.prototype.default = function(val) {
414
+ if (arguments.length === 1) {
415
+ if (val === void 0) {
416
+ this.defaultValue = void 0;
417
+ return void 0;
418
+ }
419
+
420
+ if (val != null && val.instanceOfSchema) {
421
+ throw new MongooseError('Cannot set default value of path `' + this.path +
422
+ '` to a mongoose Schema instance.');
423
+ }
424
+
425
+ this.defaultValue = val;
426
+ return this.defaultValue;
427
+ } else if (arguments.length > 1) {
428
+ this.defaultValue = [...arguments];
429
+ }
430
+ return this.defaultValue;
431
+ };
432
+
433
+ /**
434
+ * Declares the index options for this schematype.
435
+ *
436
+ * #### Example:
437
+ *
438
+ * const s = new Schema({ name: { type: String, index: true })
439
+ * const s = new Schema({ name: { type: String, index: -1 })
440
+ * const s = new Schema({ loc: { type: [Number], index: 'hashed' })
441
+ * const s = new Schema({ loc: { type: [Number], index: '2d', sparse: true })
442
+ * const s = new Schema({ loc: { type: [Number], index: { type: '2dsphere', sparse: true }})
443
+ * const s = new Schema({ date: { type: Date, index: { unique: true, expires: '1d' }})
444
+ * s.path('my.path').index(true);
445
+ * s.path('my.date').index({ expires: 60 });
446
+ * s.path('my.path').index({ unique: true, sparse: true });
447
+ *
448
+ * #### Note:
449
+ *
450
+ * _Indexes are created [in the background](https://www.mongodb.com/docs/manual/core/index-creation/#index-creation-background)
451
+ * by default. If `background` is set to `false`, MongoDB will not execute any
452
+ * read/write operations you send until the index build.
453
+ * Specify `background: false` to override Mongoose's default._
454
+ *
455
+ * @param {Object|Boolean|String|Number} options
456
+ * @return {SchemaType} this
457
+ * @api public
458
+ */
459
+
460
+ SchemaType.prototype.index = function(options) {
461
+ this._index = options;
462
+ utils.expires(this._index);
463
+ return this;
464
+ };
465
+
466
+ /**
467
+ * Declares an unique index.
468
+ *
469
+ * #### Example:
470
+ *
471
+ * const s = new Schema({ name: { type: String, unique: true } });
472
+ * s.path('name').index({ unique: true });
473
+ *
474
+ * _NOTE: violating the constraint returns an `E11000` error from MongoDB when saving, not a Mongoose validation error._
475
+ *
476
+ * You can optionally specify an error message to replace MongoDB's default `E11000 duplicate key error` message.
477
+ * The following will throw a "Email must be unique" error if `save()`, `updateOne()`, `updateMany()`, `replaceOne()`,
478
+ * `findOneAndUpdate()`, or `findOneAndReplace()` throws a duplicate key error:
479
+ *
480
+ * ```javascript
481
+ * new Schema({
482
+ * email: {
483
+ * type: String,
484
+ * unique: [true, 'Email must be unique']
485
+ * }
486
+ * });
487
+ * ```
488
+ *
489
+ * Note that the above syntax does **not** work for `bulkWrite()` or `insertMany()`. `bulkWrite()` and `insertMany()`
490
+ * will still throw MongoDB's default `E11000 duplicate key error` message.
491
+ *
492
+ * @param {Boolean} value
493
+ * @param {String} [message]
494
+ * @return {SchemaType} this
495
+ * @api public
496
+ */
497
+
498
+ SchemaType.prototype.unique = function unique(value, message) {
499
+ if (this._index === false) {
500
+ if (!value) {
501
+ return;
502
+ }
503
+ throw new Error('Path "' + this.path + '" may not have `index` set to ' +
504
+ 'false and `unique` set to true');
505
+ }
506
+
507
+ if (!Object.hasOwn(this.options, 'index') && value === false) {
508
+ return this;
509
+ }
510
+
511
+ if (this._index == null || this._index === true) {
512
+ this._index = {};
513
+ } else if (typeof this._index === 'string') {
514
+ this._index = { type: this._index };
515
+ }
516
+
517
+ this._index.unique = !!value;
518
+ if (typeof message === 'string') {
519
+ this._duplicateKeyErrorMessage = message;
520
+ }
521
+ return this;
522
+ };
523
+
524
+ /**
525
+ * Declares a full text index.
526
+ *
527
+ * ### Example:
528
+ *
529
+ * const s = new Schema({ name : { type: String, text : true } })
530
+ * s.path('name').index({ text : true });
531
+ *
532
+ * @param {Boolean} bool
533
+ * @return {SchemaType} this
534
+ * @api public
535
+ */
536
+
537
+ SchemaType.prototype.text = function(bool) {
538
+ if (this._index === false) {
539
+ if (!bool) {
540
+ return this;
541
+ }
542
+ throw new Error('Path "' + this.path + '" may not have `index` set to ' +
543
+ 'false and `text` set to true');
544
+ }
545
+
546
+ if (!Object.hasOwn(this.options, 'index') && bool === false) {
547
+ return this;
548
+ }
549
+
550
+ if (this._index === null || this._index === undefined ||
551
+ typeof this._index === 'boolean') {
552
+ this._index = {};
553
+ } else if (typeof this._index === 'string') {
554
+ this._index = { type: this._index };
555
+ }
556
+
557
+ this._index.text = bool;
558
+ return this;
559
+ };
560
+
561
+ /**
562
+ * Declares a sparse index.
563
+ *
564
+ * #### Example:
565
+ *
566
+ * const s = new Schema({ name: { type: String, sparse: true } });
567
+ * s.path('name').index({ sparse: true });
568
+ *
569
+ * @param {Boolean} bool
570
+ * @return {SchemaType} this
571
+ * @api public
572
+ */
573
+
574
+ SchemaType.prototype.sparse = function(bool) {
575
+ if (this._index === false) {
576
+ if (!bool) {
577
+ return this;
578
+ }
579
+ throw new Error('Path "' + this.path + '" may not have `index` set to ' +
580
+ 'false and `sparse` set to true');
581
+ }
582
+
583
+ if (!Object.hasOwn(this.options, 'index') && bool === false) {
584
+ return this;
585
+ }
586
+
587
+ if (this._index == null || typeof this._index === 'boolean') {
588
+ this._index = {};
589
+ } else if (typeof this._index === 'string') {
590
+ this._index = { type: this._index };
591
+ }
592
+
593
+ this._index.sparse = bool;
594
+ return this;
595
+ };
596
+
597
+ /**
598
+ * Defines this path as immutable. Mongoose prevents you from changing
599
+ * immutable paths unless the parent document has [`isNew: true`](https://mongoosejs.com/docs/api/document.html#Document.prototype.isNew()).
600
+ *
601
+ * #### Example:
602
+ *
603
+ * const schema = new Schema({
604
+ * name: { type: String, immutable: true },
605
+ * age: Number
606
+ * });
607
+ * const Model = mongoose.model('Test', schema);
608
+ *
609
+ * await Model.create({ name: 'test' });
610
+ * const doc = await Model.findOne();
611
+ *
612
+ * doc.isNew; // false
613
+ * doc.name = 'new name';
614
+ * doc.name; // 'test', because `name` is immutable
615
+ *
616
+ * Mongoose also prevents changing immutable properties using `updateOne()`
617
+ * and `updateMany()` based on [strict mode](https://mongoosejs.com/docs/guide.html#strict).
618
+ *
619
+ * #### Example:
620
+ *
621
+ * // Mongoose will strip out the `name` update, because `name` is immutable
622
+ * Model.updateOne({}, { $set: { name: 'test2' }, $inc: { age: 1 } });
623
+ *
624
+ * // If `strict` is set to 'throw', Mongoose will throw an error if you
625
+ * // update `name`
626
+ * const err = await Model.updateOne({}, { name: 'test2' }, { strict: 'throw' }).
627
+ * then(() => null, err => err);
628
+ * err.name; // StrictModeError
629
+ *
630
+ * // If `strict` is `false`, Mongoose allows updating `name` even though
631
+ * // the property is immutable.
632
+ * Model.updateOne({}, { name: 'test2' }, { strict: false });
633
+ *
634
+ * @param {Boolean} bool
635
+ * @return {SchemaType} this
636
+ * @see isNew https://mongoosejs.com/docs/api/document.html#Document.prototype.isNew()
637
+ * @api public
638
+ */
639
+
640
+ SchemaType.prototype.immutable = function(bool) {
641
+ this.$immutable = bool;
642
+ handleImmutable(this);
643
+
644
+ return this;
645
+ };
646
+
647
+ /**
648
+ * Defines a custom function for transforming this path when converting a document to JSON.
649
+ *
650
+ * Mongoose calls this function with one parameter: the current `value` of the path. Mongoose
651
+ * then uses the return value in the JSON output.
652
+ *
653
+ * #### Example:
654
+ *
655
+ * const schema = new Schema({
656
+ * date: { type: Date, transform: v => v.getFullYear() }
657
+ * });
658
+ * const Model = mongoose.model('Test', schema);
659
+ *
660
+ * await Model.create({ date: new Date('2016-06-01') });
661
+ * const doc = await Model.findOne();
662
+ *
663
+ * doc.date instanceof Date; // true
664
+ *
665
+ * doc.toJSON().date; // 2016 as a number
666
+ * JSON.stringify(doc); // '{"_id":...,"date":2016}'
667
+ *
668
+ * @param {Function} fn
669
+ * @return {SchemaType} this
670
+ * @api public
671
+ */
672
+
673
+ SchemaType.prototype.transform = function(fn) {
674
+ this.options.transform = fn;
675
+
676
+ return this;
677
+ };
678
+
679
+ /**
680
+ * Adds a setter to this schematype.
681
+ *
682
+ * #### Example:
683
+ *
684
+ * function capitalize (val) {
685
+ * if (typeof val !== 'string') val = '';
686
+ * return val.charAt(0).toUpperCase() + val.substring(1);
687
+ * }
688
+ *
689
+ * // defining within the schema
690
+ * const s = new Schema({ name: { type: String, set: capitalize }});
691
+ *
692
+ * // or with the SchemaType
693
+ * const s = new Schema({ name: String })
694
+ * s.path('name').set(capitalize);
695
+ *
696
+ * Setters allow you to transform the data before it gets to the raw mongodb
697
+ * document or query.
698
+ *
699
+ * Suppose you are implementing user registration for a website. Users provide
700
+ * an email and password, which gets saved to mongodb. The email is a string
701
+ * that you will want to normalize to lower case, in order to avoid one email
702
+ * having more than one account -- e.g., otherwise, avenue@q.com can be registered for 2 accounts via avenue@q.com and AvEnUe@Q.CoM.
703
+ *
704
+ * You can set up email lower case normalization easily via a Mongoose setter.
705
+ *
706
+ * function toLower(v) {
707
+ * return v.toLowerCase();
708
+ * }
709
+ *
710
+ * const UserSchema = new Schema({
711
+ * email: { type: String, set: toLower }
712
+ * });
713
+ *
714
+ * const User = db.model('User', UserSchema);
715
+ *
716
+ * const user = new User({email: 'AVENUE@Q.COM'});
717
+ * console.log(user.email); // 'avenue@q.com'
718
+ *
719
+ * // or
720
+ * const user = new User();
721
+ * user.email = 'Avenue@Q.com';
722
+ * console.log(user.email); // 'avenue@q.com'
723
+ * User.updateOne({ _id: _id }, { $set: { email: 'AVENUE@Q.COM' } }); // update to 'avenue@q.com'
724
+ *
725
+ * // Setters also transform query filters
726
+ * const user = await User.find({ email: 'AVENUE@Q.COM' }); // query for 'avenue@q.com'
727
+ *
728
+ * As you can see above, setters allow you to transform the data before it
729
+ * stored in MongoDB, or before executing a query.
730
+ *
731
+ * _NOTE: we could have also just used the built-in [`lowercase: true` SchemaType option](https://mongoosejs.com/docs/api/schemastringoptions.html#SchemaStringOptions.prototype.lowercase) instead of defining our own function._
732
+ *
733
+ * new Schema({ email: { type: String, lowercase: true }})
734
+ *
735
+ * Setters are also passed a second argument, the schematype on which the setter was defined. This allows for tailored behavior based on options passed in the schema.
736
+ *
737
+ * function inspector (val, priorValue, schematype) {
738
+ * if (schematype.options.required) {
739
+ * return schematype.path + ' is required';
740
+ * } else {
741
+ * return val;
742
+ * }
743
+ * }
744
+ *
745
+ * const VirusSchema = new Schema({
746
+ * name: { type: String, required: true, set: inspector },
747
+ * taxonomy: { type: String, set: inspector }
748
+ * })
749
+ *
750
+ * const Virus = db.model('Virus', VirusSchema);
751
+ * const v = new Virus({ name: 'Parvoviridae', taxonomy: 'Parvovirinae' });
752
+ *
753
+ * console.log(v.name); // name is required
754
+ * console.log(v.taxonomy); // Parvovirinae
755
+ *
756
+ * You can also use setters to modify other properties on the document. If
757
+ * you're setting a property `name` on a document, the setter will run with
758
+ * `this` as the document. Be careful, in mongoose 5 setters will also run
759
+ * when querying by `name` with `this` as the query.
760
+ *
761
+ * const nameSchema = new Schema({ name: String, keywords: [String] });
762
+ * nameSchema.path('name').set(function(v) {
763
+ * // Need to check if `this` is a document, because in mongoose 5
764
+ * // setters will also run on queries, in which case `this` will be a
765
+ * // mongoose query object.
766
+ * if (this instanceof Document && v != null) {
767
+ * this.keywords = v.split(' ');
768
+ * }
769
+ * return v;
770
+ * });
771
+ *
772
+ * @param {Function} fn
773
+ * @return {SchemaType} this
774
+ * @api public
775
+ */
776
+
777
+ SchemaType.prototype.set = function(fn) {
778
+ if (typeof fn !== 'function') {
779
+ throw new TypeError('A setter must be a function.');
780
+ }
781
+ this.setters.push(fn);
782
+ return this;
783
+ };
784
+
785
+ /**
786
+ * Adds a getter to this schematype.
787
+ *
788
+ * #### Example:
789
+ *
790
+ * function dob (val) {
791
+ * if (!val) return val;
792
+ * return (val.getMonth() + 1) + "/" + val.getDate() + "/" + val.getFullYear();
793
+ * }
794
+ *
795
+ * // defining within the schema
796
+ * const s = new Schema({ born: { type: Date, get: dob })
797
+ *
798
+ * // or by retreiving its SchemaType
799
+ * const s = new Schema({ born: Date })
800
+ * s.path('born').get(dob)
801
+ *
802
+ * Getters allow you to transform the representation of the data as it travels from the raw mongodb document to the value that you see.
803
+ *
804
+ * Suppose you are storing credit card numbers and you want to hide everything except the last 4 digits to the mongoose user. You can do so by defining a getter in the following way:
805
+ *
806
+ * function obfuscate (cc) {
807
+ * return '****-****-****-' + cc.slice(cc.length-4, cc.length);
808
+ * }
809
+ *
810
+ * const AccountSchema = new Schema({
811
+ * creditCardNumber: { type: String, get: obfuscate }
812
+ * });
813
+ *
814
+ * const Account = db.model('Account', AccountSchema);
815
+ *
816
+ * Account.findById(id, function (err, found) {
817
+ * console.log(found.creditCardNumber); // '****-****-****-1234'
818
+ * });
819
+ *
820
+ * Getters are also passed a second argument, the schematype on which the getter was defined. This allows for tailored behavior based on options passed in the schema.
821
+ *
822
+ * function inspector (val, priorValue, schematype) {
823
+ * if (schematype.options.required) {
824
+ * return schematype.path + ' is required';
825
+ * } else {
826
+ * return schematype.path + ' is not';
827
+ * }
828
+ * }
829
+ *
830
+ * const VirusSchema = new Schema({
831
+ * name: { type: String, required: true, get: inspector },
832
+ * taxonomy: { type: String, get: inspector }
833
+ * })
834
+ *
835
+ * const Virus = db.model('Virus', VirusSchema);
836
+ *
837
+ * Virus.findById(id, function (err, virus) {
838
+ * console.log(virus.name); // name is required
839
+ * console.log(virus.taxonomy); // taxonomy is not
840
+ * })
841
+ *
842
+ * @param {Function} fn
843
+ * @return {SchemaType} this
844
+ * @api public
845
+ */
846
+
847
+ SchemaType.prototype.get = function(fn) {
848
+ if (typeof fn !== 'function') {
849
+ throw new TypeError('A getter must be a function.');
850
+ }
851
+ this.getters.push(fn);
852
+ return this;
853
+ };
854
+
855
+ /**
856
+ * Adds multiple validators for this document path.
857
+ * Calls `validate()` for every element in validators.
858
+ *
859
+ * @param {Array<RegExp|Function|Object>} validators
860
+ * @returns this
861
+ */
862
+
863
+ SchemaType.prototype.validateAll = function(validators) {
864
+ for (let i = 0; i < validators.length; i++) {
865
+ this.validate(validators[i]);
866
+ }
867
+ return this;
868
+ };
869
+
870
+ /**
871
+ * Adds validator(s) for this document path.
872
+ *
873
+ * Validators always receive the value to validate as their first argument and
874
+ * must return `Boolean`. Returning `false` or throwing an error means
875
+ * validation failed.
876
+ *
877
+ * The error message argument is optional. If not passed, the [default generic error message template](https://mongoosejs.com/docs/api/error.html#Error.messages) will be used.
878
+ *
879
+ * #### Example:
880
+ *
881
+ * // make sure every value is equal to "something"
882
+ * function validator (val) {
883
+ * return val === 'something';
884
+ * }
885
+ * new Schema({ name: { type: String, validate: validator }});
886
+ *
887
+ * // with a custom error message
888
+ *
889
+ * const custom = [validator, 'Uh oh, {PATH} does not equal "something".']
890
+ * new Schema({ name: { type: String, validate: custom }});
891
+ *
892
+ * // adding many validators at a time
893
+ *
894
+ * const many = [
895
+ * { validator: validator, message: 'uh oh' }
896
+ * , { validator: anotherValidator, message: 'failed' }
897
+ * ]
898
+ * new Schema({ name: { type: String, validate: many }});
899
+ *
900
+ * // or utilizing SchemaType methods directly:
901
+ *
902
+ * const schema = new Schema({ name: 'string' });
903
+ * schema.path('name').validate(validator, 'validation of `{PATH}` failed with value `{VALUE}`');
904
+ *
905
+ * #### Error message templates:
906
+ *
907
+ * Below is a list of supported template keywords:
908
+ *
909
+ * - PATH: The schema path where the error is being triggered.
910
+ * - VALUE: The value assigned to the PATH that is triggering the error.
911
+ * - KIND: The validation property that triggered the error i.e. required.
912
+ * - REASON: The error object that caused this error if there was one.
913
+ *
914
+ * If Mongoose's built-in error message templating isn't enough, Mongoose
915
+ * supports setting the `message` property to a function.
916
+ *
917
+ * schema.path('name').validate({
918
+ * validator: function(v) { return v.length > 5; },
919
+ * // `errors['name']` will be "name must have length 5, got 'foo'"
920
+ * message: function(props) {
921
+ * return `${props.path} must have length 5, got '${props.value}'`;
922
+ * }
923
+ * });
924
+ *
925
+ * To bypass Mongoose's error messages and just copy the error message that
926
+ * the validator throws, do this:
927
+ *
928
+ * schema.path('name').validate({
929
+ * validator: function() { throw new Error('Oops!'); },
930
+ * // `errors['name'].message` will be "Oops!"
931
+ * message: function(props) { return props.reason.message; }
932
+ * });
933
+ *
934
+ * #### Asynchronous validation:
935
+ *
936
+ * Mongoose supports validators that return a promise. A validator that returns
937
+ * a promise is called an _async validator_. Async validators run in
938
+ * parallel, and `validate()` will wait until all async validators have settled.
939
+ *
940
+ * schema.path('name').validate({
941
+ * validator: function (value) {
942
+ * return new Promise(function (resolve, reject) {
943
+ * resolve(false); // validation failed
944
+ * });
945
+ * }
946
+ * });
947
+ *
948
+ * You might use asynchronous validators to retreive other documents from the database to validate against or to meet other I/O bound validation needs.
949
+ *
950
+ * Validation occurs `pre('save')` or whenever you manually execute [document#validate](https://mongoosejs.com/docs/api/document.html#Document.prototype.validate()).
951
+ *
952
+ * If validation fails during `pre('save')` and no callback was passed to receive the error, an `error` event will be emitted on your Models associated db [connection](https://mongoosejs.com/docs/api/connection.html#Connection()), passing the validation error object along.
953
+ *
954
+ * const conn = mongoose.createConnection(..);
955
+ * conn.on('error', handleError);
956
+ *
957
+ * const Product = conn.model('Product', yourSchema);
958
+ * const dvd = new Product(..);
959
+ * dvd.save(); // emits error on the `conn` above
960
+ *
961
+ * If you want to handle these errors at the Model level, add an `error`
962
+ * listener to your Model as shown below.
963
+ *
964
+ * // registering an error listener on the Model lets us handle errors more locally
965
+ * Product.on('error', handleError);
966
+ *
967
+ * @param {RegExp|Function|Object} obj validator function, or hash describing options
968
+ * @param {Function} [obj.validator] validator function. If the validator function returns `undefined` or a truthy value, validation succeeds. If it returns [falsy](https://masteringjs.io/tutorials/fundamentals/falsy) (except `undefined`) or throws an error, validation fails.
969
+ * @param {String|Function} [obj.message] optional error message. If function, should return the error message as a string
970
+ * @param {Boolean} [obj.propsParameter=false] If true, Mongoose will pass the validator properties object (with the `validator` function, `message`, etc.) as the 2nd arg to the validator function. This is disabled by default because many validators [rely on positional args](https://github.com/chriso/validator.js#validators), so turning this on may cause unpredictable behavior in external validators.
971
+ * @param {String|Function} [errorMsg] optional error message. If function, should return the error message as a string
972
+ * @param {String} [type] optional validator type
973
+ * @return {SchemaType} this
974
+ * @api public
975
+ */
976
+
977
+ SchemaType.prototype.validate = function(obj, message, type) {
978
+ if (typeof obj === 'function' || obj && utils.getFunctionName(obj.constructor) === 'RegExp') {
979
+ let properties;
980
+ if (typeof message === 'function') {
981
+ properties = { validator: obj, message: message };
982
+ properties.type = type || 'user defined';
983
+ } else if (message instanceof Object && !type) {
984
+ properties = isSimpleValidator(message) ? Object.assign({}, message) : clone(message);
985
+ if (!properties.message) {
986
+ properties.message = properties.msg;
987
+ }
988
+ properties.validator = obj;
989
+ properties.type = properties.type || 'user defined';
990
+ } else {
991
+ if (message == null) {
992
+ message = MongooseError.messages.general.default;
993
+ }
994
+ if (!type) {
995
+ type = 'user defined';
996
+ }
997
+ properties = { message: message, type: type, validator: obj };
998
+ }
999
+
1000
+ this.validators.push(properties);
1001
+ return this;
1002
+ }
1003
+
1004
+ let i;
1005
+ let length;
1006
+ let arg;
1007
+
1008
+ for (i = 0, length = arguments.length; i < length; i++) {
1009
+ arg = arguments[i];
1010
+ if (!utils.isPOJO(arg)) {
1011
+ const msg = 'Invalid validator. Received (' + typeof arg + ') '
1012
+ + arg
1013
+ + '. See https://mongoosejs.com/docs/api/schematype.html#SchemaType.prototype.validate()';
1014
+
1015
+ throw new Error(msg);
1016
+ }
1017
+ this.validate(arg.validator, arg);
1018
+ }
1019
+
1020
+ return this;
1021
+ };
1022
+
1023
+ /**
1024
+ * Adds a required validator to this SchemaType. The validator gets added
1025
+ * to the front of this SchemaType's validators array using `unshift()`.
1026
+ *
1027
+ * #### Example:
1028
+ *
1029
+ * const s = new Schema({ born: { type: Date, required: true })
1030
+ *
1031
+ * // or with custom error message
1032
+ *
1033
+ * const s = new Schema({ born: { type: Date, required: '{PATH} is required!' })
1034
+ *
1035
+ * // or with a function
1036
+ *
1037
+ * const s = new Schema({
1038
+ * userId: ObjectId,
1039
+ * username: {
1040
+ * type: String,
1041
+ * required: function() { return this.userId != null; }
1042
+ * }
1043
+ * })
1044
+ *
1045
+ * // or with a function and a custom message
1046
+ * const s = new Schema({
1047
+ * userId: ObjectId,
1048
+ * username: {
1049
+ * type: String,
1050
+ * required: [
1051
+ * function() { return this.userId != null; },
1052
+ * 'username is required if id is specified'
1053
+ * ]
1054
+ * }
1055
+ * })
1056
+ *
1057
+ * // or through the path API
1058
+ *
1059
+ * s.path('name').required(true);
1060
+ *
1061
+ * // with custom error messaging
1062
+ *
1063
+ * s.path('name').required(true, 'grrr :( ');
1064
+ *
1065
+ * // or make a path conditionally required based on a function
1066
+ * const isOver18 = function() { return this.age >= 18; };
1067
+ * s.path('voterRegistrationId').required(isOver18);
1068
+ *
1069
+ * The required validator uses the SchemaType's `checkRequired` function to
1070
+ * determine whether a given value satisfies the required validator. By default,
1071
+ * a value satisfies the required validator if `val != null` (that is, if
1072
+ * the value is not null nor undefined). However, most built-in mongoose schema
1073
+ * types override the default `checkRequired` function:
1074
+ *
1075
+ * @param {Boolean|Function|Object} required enable/disable the validator, or function that returns required boolean, or options object
1076
+ * @param {Boolean|Function} [options.isRequired] enable/disable the validator, or function that returns required boolean
1077
+ * @param {Function} [options.ErrorConstructor] custom error constructor. The constructor receives 1 parameter, an object containing the validator properties.
1078
+ * @param {String} [message] optional custom error message
1079
+ * @return {SchemaType} this
1080
+ * @see Customized Error Messages https://mongoosejs.com/docs/api/error.html#Error.messages
1081
+ * @see SchemaArray#checkRequired https://mongoosejs.com/docs/api/schemaarray.html#SchemaArray.prototype.checkRequired()
1082
+ * @see SchemaBoolean#checkRequired https://mongoosejs.com/docs/api/schemaboolean.html#SchemaBoolean.prototype.checkRequired()
1083
+ * @see SchemaBuffer#checkRequired https://mongoosejs.com/docs/api/schemabuffer.html#SchemaBuffer.prototype.checkRequired()
1084
+ * @see SchemaNumber#checkRequired https://mongoosejs.com/docs/api/schemanumber.html#SchemaNumber.prototype.checkRequired()
1085
+ * @see SchemaObjectId#checkRequired https://mongoosejs.com/docs/api/schemaobjectid.html#ObjectId.prototype.checkRequired()
1086
+ * @see SchemaString#checkRequired https://mongoosejs.com/docs/api/schemastring.html#SchemaString.prototype.checkRequired()
1087
+ * @api public
1088
+ */
1089
+
1090
+ SchemaType.prototype.required = function(required, message) {
1091
+ let customOptions = {};
1092
+
1093
+ if (arguments.length > 0 && required == null) {
1094
+ this.validators = this.validators.filter(function(v) {
1095
+ return v.validator !== this.requiredValidator;
1096
+ }, this);
1097
+
1098
+ this.isRequired = false;
1099
+ delete this.originalRequiredValue;
1100
+ return this;
1101
+ }
1102
+
1103
+ if (typeof required === 'object') {
1104
+ customOptions = required;
1105
+ message = customOptions.message || message;
1106
+ required = required.isRequired;
1107
+ }
1108
+
1109
+ if (required === false) {
1110
+ this.validators = this.validators.filter(function(v) {
1111
+ return v.validator !== this.requiredValidator;
1112
+ }, this);
1113
+
1114
+ this.isRequired = false;
1115
+ delete this.originalRequiredValue;
1116
+ return this;
1117
+ }
1118
+
1119
+ const _this = this;
1120
+ this.isRequired = true;
1121
+
1122
+ this.requiredValidator = function(v) {
1123
+ const cachedRequired = this && this.$__ && this.$__.cachedRequired;
1124
+
1125
+ // no validation when this path wasn't selected in the query.
1126
+ if (cachedRequired != null && !this.$__isSelected(_this.path) && !this[documentIsModified](_this.path)) {
1127
+ return true;
1128
+ }
1129
+
1130
+ // `$cachedRequired` gets set in `_evaluateRequiredFunctions()` so we
1131
+ // don't call required functions multiple times in one validate call
1132
+ // See gh-6801
1133
+ if (cachedRequired != null && _this.path in cachedRequired) {
1134
+ const res = cachedRequired[_this.path] ?
1135
+ _this.checkRequired(v, this) :
1136
+ true;
1137
+ delete cachedRequired[_this.path];
1138
+ return res;
1139
+ } else if (typeof required === 'function') {
1140
+ return required.apply(this) ? _this.checkRequired(v, this) : true;
1141
+ }
1142
+
1143
+ return _this.checkRequired(v, this);
1144
+ };
1145
+ this.originalRequiredValue = required;
1146
+
1147
+ if (typeof required === 'string') {
1148
+ message = required;
1149
+ required = undefined;
1150
+ }
1151
+
1152
+ const msg = message || MongooseError.messages.general.required;
1153
+ this.validators.unshift(Object.assign({}, customOptions, {
1154
+ validator: this.requiredValidator,
1155
+ message: msg,
1156
+ type: 'required'
1157
+ }));
1158
+
1159
+ return this;
1160
+ };
1161
+
1162
+ /**
1163
+ * Set the model that this path refers to. This is the option that [populate](https://mongoosejs.com/docs/populate.html)
1164
+ * looks at to determine the foreign collection it should query.
1165
+ *
1166
+ * #### Example:
1167
+ *
1168
+ * const userSchema = new Schema({ name: String });
1169
+ * const User = mongoose.model('User', userSchema);
1170
+ *
1171
+ * const postSchema = new Schema({ user: mongoose.ObjectId });
1172
+ * postSchema.path('user').ref('User'); // Can set ref to a model name
1173
+ * postSchema.path('user').ref(User); // Or a model class
1174
+ * postSchema.path('user').ref(() => 'User'); // Or a function that returns the model name
1175
+ * postSchema.path('user').ref(() => User); // Or a function that returns the model class
1176
+ *
1177
+ * // Or you can just declare the `ref` inline in your schema
1178
+ * const postSchema2 = new Schema({
1179
+ * user: { type: mongoose.ObjectId, ref: User }
1180
+ * });
1181
+ *
1182
+ * @param {String|Model|Function} ref either a model name, a [Model](https://mongoosejs.com/docs/models.html), or a function that returns a model name or model.
1183
+ * @return {SchemaType} this
1184
+ * @api public
1185
+ */
1186
+
1187
+ SchemaType.prototype.ref = function(ref) {
1188
+ this.options.ref = ref;
1189
+ return this;
1190
+ };
1191
+
1192
+ /**
1193
+ * Gets the default value
1194
+ *
1195
+ * @param {Object} scope the scope which callback are executed
1196
+ * @param {Boolean} init
1197
+ * @return {Any} The Stored default value.
1198
+ * @api private
1199
+ */
1200
+
1201
+ SchemaType.prototype.getDefault = function(scope, init, options) {
1202
+ let ret;
1203
+ if (this.defaultValue == null) {
1204
+ return this.defaultValue;
1205
+ }
1206
+ if (typeof this.defaultValue === 'function') {
1207
+ if (
1208
+ this.defaultValue === Date.now ||
1209
+ this.defaultValue === Array ||
1210
+ this.defaultValue.name.toLowerCase() === 'objectid'
1211
+ ) {
1212
+ ret = this.defaultValue.call(scope);
1213
+ } else {
1214
+ ret = this.defaultValue.call(scope, scope);
1215
+ }
1216
+ } else {
1217
+ ret = this.defaultValue;
1218
+ }
1219
+
1220
+ if (ret !== null && ret !== undefined) {
1221
+ if (typeof ret === 'object' && (!this.options || !this.options.shared)) {
1222
+ ret = clone(ret);
1223
+ }
1224
+
1225
+ if (options && options.skipCast) {
1226
+ return this._applySetters(ret, scope);
1227
+ }
1228
+
1229
+ const casted = this.applySetters(ret, scope, init, undefined, setOptionsForDefaults);
1230
+ if (casted && !Array.isArray(casted) && casted.$isSingleNested) {
1231
+ casted.$__parent = scope;
1232
+ }
1233
+ return casted;
1234
+ }
1235
+ return ret;
1236
+ };
1237
+
1238
+ /**
1239
+ * Applies setters without casting
1240
+ *
1241
+ * @param {Any} value
1242
+ * @param {Any} scope
1243
+ * @param {Boolean} init
1244
+ * @param {Any} priorVal
1245
+ * @param {Object} [options]
1246
+ * @instance
1247
+ * @api private
1248
+ */
1249
+
1250
+ SchemaType.prototype._applySetters = function(value, scope, init, priorVal, options) {
1251
+ let v = value;
1252
+ if (init) {
1253
+ return v;
1254
+ }
1255
+ const setters = this.setters;
1256
+
1257
+ for (let i = setters.length - 1; i >= 0; i--) {
1258
+ v = setters[i].call(scope, v, priorVal, this, options);
1259
+ }
1260
+
1261
+ return v;
1262
+ };
1263
+
1264
+ /*!
1265
+ * ignore
1266
+ */
1267
+
1268
+ SchemaType.prototype._castNullish = function _castNullish(v) {
1269
+ return v;
1270
+ };
1271
+
1272
+ /**
1273
+ * Applies setters
1274
+ *
1275
+ * @param {Object} value
1276
+ * @param {Object} scope
1277
+ * @param {Boolean} init
1278
+ * @return {Any}
1279
+ * @api private
1280
+ */
1281
+
1282
+ SchemaType.prototype.applySetters = function(value, scope, init, priorVal, options) {
1283
+ let v = this._applySetters(value, scope, init, priorVal, options);
1284
+ if (v == null) {
1285
+ return this._castNullish(v);
1286
+ }
1287
+ // do not cast until all setters are applied #665
1288
+ v = this.cast(v, scope, init, priorVal, options);
1289
+
1290
+ return v;
1291
+ };
1292
+
1293
+ /**
1294
+ * Applies getters to a value
1295
+ *
1296
+ * @param {Object} value
1297
+ * @param {Object} scope
1298
+ * @return {Any}
1299
+ * @api private
1300
+ */
1301
+
1302
+ SchemaType.prototype.applyGetters = function(value, scope) {
1303
+ let v = value;
1304
+ const getters = this.getters;
1305
+ const len = getters.length;
1306
+
1307
+ if (len === 0) {
1308
+ return v;
1309
+ }
1310
+
1311
+ for (let i = 0; i < len; ++i) {
1312
+ v = getters[i].call(scope, v, this);
1313
+ }
1314
+
1315
+ return v;
1316
+ };
1317
+
1318
+ /**
1319
+ * Sets default `select()` behavior for this path.
1320
+ *
1321
+ * Set to `true` if this path should always be included in the results, `false` if it should be excluded by default. This setting can be overridden at the query level.
1322
+ *
1323
+ * #### Example:
1324
+ *
1325
+ * T = db.model('T', new Schema({ x: { type: String, select: true }}));
1326
+ * T.find(..); // field x will always be selected ..
1327
+ * // .. unless overridden;
1328
+ * T.find().select('-x').exec(callback);
1329
+ *
1330
+ * @param {Boolean} val
1331
+ * @return {SchemaType} this
1332
+ * @api public
1333
+ */
1334
+
1335
+ SchemaType.prototype.select = function select(val) {
1336
+ this.selected = !!val;
1337
+ return this;
1338
+ };
1339
+
1340
+ /**
1341
+ * Performs a validation of `value` using the validators declared for this SchemaType.
1342
+ *
1343
+ * @param {Any} value
1344
+ * @param {Function} callback
1345
+ * @param {Object} scope
1346
+ * @param {Object} [options]
1347
+ * @param {String} [options.path]
1348
+ * @return {Any} If no validators, returns the output from calling `fn`, otherwise no return
1349
+ * @api public
1350
+ */
1351
+
1352
+ SchemaType.prototype.doValidate = function(value, fn, scope, options) {
1353
+ let err = false;
1354
+ const path = this.path;
1355
+ if (typeof fn !== 'function') {
1356
+ throw new TypeError(`Must pass callback function to doValidate(), got ${typeof fn}`);
1357
+ }
1358
+
1359
+ // Avoid non-object `validators`
1360
+ const validators = this.validators.
1361
+ filter(v => typeof v === 'object' && v !== null);
1362
+
1363
+ let count = validators.length;
1364
+
1365
+ if (!count) {
1366
+ return fn(null);
1367
+ }
1368
+
1369
+ for (let i = 0, len = validators.length; i < len; ++i) {
1370
+ if (err) {
1371
+ break;
1372
+ }
1373
+
1374
+ const v = validators[i];
1375
+ const validator = v.validator;
1376
+ let ok;
1377
+
1378
+ const validatorProperties = isSimpleValidator(v) ? Object.assign({}, v) : clone(v);
1379
+ validatorProperties.path = options && options.path ? options.path : path;
1380
+ validatorProperties.fullPath = this.$fullPath;
1381
+ validatorProperties.value = value;
1382
+ if (typeof value === 'string') {
1383
+ validatorProperties.length = value.length;
1384
+ if (validatorProperties.value.length > 30) {
1385
+ validatorProperties.value = validatorProperties.value.slice(0, 30) + '...';
1386
+ }
1387
+ }
1388
+
1389
+ if (validator instanceof RegExp) {
1390
+ validate(validator.test(value), validatorProperties, scope);
1391
+ continue;
1392
+ }
1393
+
1394
+ if (typeof validator !== 'function') {
1395
+ continue;
1396
+ }
1397
+
1398
+ if (value === undefined && validator !== this.requiredValidator) {
1399
+ validate(true, validatorProperties, scope);
1400
+ continue;
1401
+ }
1402
+
1403
+ try {
1404
+ if (validatorProperties.propsParameter) {
1405
+ ok = validator.call(scope, value, validatorProperties);
1406
+ } else {
1407
+ ok = validator.call(scope, value);
1408
+ }
1409
+ } catch (error) {
1410
+ ok = false;
1411
+ validatorProperties.reason = error;
1412
+ if (error.message) {
1413
+ validatorProperties.message = error.message;
1414
+ }
1415
+ }
1416
+
1417
+ if (ok != null && typeof ok.then === 'function') {
1418
+ ok.then(
1419
+ function(ok) { validate(ok, validatorProperties, scope); },
1420
+ function(error) {
1421
+ validatorProperties.reason = error;
1422
+ validatorProperties.message = error.message;
1423
+ ok = false;
1424
+ validate(ok, validatorProperties, scope);
1425
+ });
1426
+ } else {
1427
+ validate(ok, validatorProperties, scope);
1428
+ }
1429
+ }
1430
+
1431
+ function validate(ok, validatorProperties, scope) {
1432
+ if (err) {
1433
+ return;
1434
+ }
1435
+ if (ok === undefined || ok) {
1436
+ if (--count <= 0) {
1437
+ immediate(function() {
1438
+ fn(null);
1439
+ });
1440
+ }
1441
+ } else {
1442
+ const ErrorConstructor = validatorProperties.ErrorConstructor || ValidatorError;
1443
+ err = new ErrorConstructor(validatorProperties, scope);
1444
+ err[validatorErrorSymbol] = true;
1445
+ immediate(function() {
1446
+ fn(err);
1447
+ });
1448
+ }
1449
+ }
1450
+ };
1451
+
1452
+
1453
+ function _validate(ok, validatorProperties) {
1454
+ if (ok !== undefined && !ok) {
1455
+ const ErrorConstructor = validatorProperties.ErrorConstructor || ValidatorError;
1456
+ const err = new ErrorConstructor(validatorProperties);
1457
+ err[validatorErrorSymbol] = true;
1458
+ return err;
1459
+ }
1460
+ }
1461
+
1462
+ /**
1463
+ * Performs a validation of `value` using the validators declared for this SchemaType.
1464
+ *
1465
+ * #### Note:
1466
+ *
1467
+ * This method ignores the asynchronous validators.
1468
+ *
1469
+ * @param {Any} value
1470
+ * @param {Object} scope
1471
+ * @param {Object} [options]
1472
+ * @param {Object} [options.path]
1473
+ * @return {MongooseError|null}
1474
+ * @api private
1475
+ */
1476
+
1477
+ SchemaType.prototype.doValidateSync = function(value, scope, options) {
1478
+ const path = this.path;
1479
+ const count = this.validators.length;
1480
+
1481
+ if (!count) {
1482
+ return null;
1483
+ }
1484
+
1485
+ let validators = this.validators;
1486
+ if (value === void 0) {
1487
+ if (this.validators.length !== 0 && this.validators[0].type === 'required') {
1488
+ validators = [this.validators[0]];
1489
+ } else {
1490
+ return null;
1491
+ }
1492
+ }
1493
+
1494
+ let err = null;
1495
+ let i = 0;
1496
+ const len = validators.length;
1497
+ for (i = 0; i < len; ++i) {
1498
+ const v = validators[i];
1499
+
1500
+ if (v === null || typeof v !== 'object') {
1501
+ continue;
1502
+ }
1503
+
1504
+ const validator = v.validator;
1505
+ const validatorProperties = isSimpleValidator(v) ? Object.assign({}, v) : clone(v);
1506
+ validatorProperties.path = options && options.path ? options.path : path;
1507
+ validatorProperties.fullPath = this.$fullPath;
1508
+ validatorProperties.value = value;
1509
+ if (typeof value === 'string') {
1510
+ validatorProperties.length = value.length;
1511
+ if (validatorProperties.value.length > 30) {
1512
+ validatorProperties.value = validatorProperties.value.slice(0, 30) + '...';
1513
+ }
1514
+ }
1515
+ let ok = false;
1516
+
1517
+ // Skip any explicit async validators. Validators that return a promise
1518
+ // will still run, but won't trigger any errors.
1519
+ if (isAsyncFunction(validator)) {
1520
+ continue;
1521
+ }
1522
+
1523
+ if (validator instanceof RegExp) {
1524
+ err = _validate(validator.test(value), validatorProperties);
1525
+ continue;
1526
+ }
1527
+
1528
+ if (typeof validator !== 'function') {
1529
+ continue;
1530
+ }
1531
+
1532
+ try {
1533
+ if (validatorProperties.propsParameter) {
1534
+ ok = validator.call(scope, value, validatorProperties);
1535
+ } else {
1536
+ ok = validator.call(scope, value);
1537
+ }
1538
+ } catch (error) {
1539
+ ok = false;
1540
+ validatorProperties.reason = error;
1541
+ }
1542
+
1543
+ // Skip any validators that return a promise, we can't handle those
1544
+ // synchronously
1545
+ if (ok != null && typeof ok.then === 'function') {
1546
+ continue;
1547
+ }
1548
+ err = _validate(ok, validatorProperties);
1549
+ if (err) {
1550
+ break;
1551
+ }
1552
+ }
1553
+
1554
+ return err;
1555
+ };
1556
+
1557
+ /**
1558
+ * Determines if value is a valid Reference.
1559
+ *
1560
+ * @param {SchemaType} self
1561
+ * @param {Object} value
1562
+ * @param {Document} doc
1563
+ * @param {Boolean} init
1564
+ * @return {Boolean}
1565
+ * @api private
1566
+ */
1567
+
1568
+ SchemaType._isRef = function(self, value, doc, init) {
1569
+ // fast path
1570
+ let ref = init && self.options && (self.options.ref || self.options.refPath);
1571
+
1572
+ if (!ref && doc && doc.$__ != null) {
1573
+ // checks for
1574
+ // - this populated with adhoc model and no ref was set in schema OR
1575
+ // - setting / pushing values after population
1576
+ const path = doc.$__fullPath(self.path, true);
1577
+
1578
+ const owner = doc.ownerDocument();
1579
+ ref = (path != null && owner.$populated(path)) || doc.$populated(self.path);
1580
+ }
1581
+
1582
+ if (ref) {
1583
+ if (value == null) {
1584
+ return true;
1585
+ }
1586
+ if (!Buffer.isBuffer(value) && // buffers are objects too
1587
+ value._bsontype !== 'Binary' // raw binary value from the db
1588
+ && utils.isObject(value) // might have deselected _id in population query
1589
+ ) {
1590
+ return true;
1591
+ }
1592
+
1593
+ return init;
1594
+ }
1595
+
1596
+ return false;
1597
+ };
1598
+
1599
+ /*!
1600
+ * ignore
1601
+ */
1602
+
1603
+ SchemaType.prototype._castRef = function _castRef(value, doc, init, options) {
1604
+ if (value == null) {
1605
+ return value;
1606
+ }
1607
+
1608
+ if (value.$__ != null) {
1609
+ value.$__.wasPopulated = value.$__.wasPopulated || { value: value._doc._id };
1610
+ return value;
1611
+ }
1612
+
1613
+ // setting a populated path
1614
+ if (Buffer.isBuffer(value) || !utils.isObject(value)) {
1615
+ if (init) {
1616
+ return value;
1617
+ }
1618
+ throw new CastError(this.instance, value, this.path, null, this);
1619
+ }
1620
+
1621
+ // Handle the case where user directly sets a populated
1622
+ // path to a plain object; cast to the Model used in
1623
+ // the population query.
1624
+ const path = doc.$__fullPath(this.path, true);
1625
+ const owner = doc.ownerDocument();
1626
+ const pop = owner.$populated(path, true);
1627
+
1628
+ let ret = value;
1629
+ if (!doc.$__.populated ||
1630
+ !doc.$__.populated[path] ||
1631
+ !doc.$__.populated[path].options ||
1632
+ !doc.$__.populated[path].options.options ||
1633
+ !doc.$__.populated[path].options.options.lean) {
1634
+ const PopulatedModel = pop ? pop.options[populateModelSymbol] : doc.constructor.db.model(this.options.ref);
1635
+ ret = PopulatedModel.hydrate(value, null, options);
1636
+ ret.$__.wasPopulated = { value: ret._doc._id, options: { [populateModelSymbol]: PopulatedModel } };
1637
+ }
1638
+
1639
+ return ret;
1640
+ };
1641
+
1642
+ /*!
1643
+ * ignore
1644
+ */
1645
+
1646
+ function handleSingle(val, context) {
1647
+ return this.castForQuery(null, val, context);
1648
+ }
1649
+
1650
+ /*!
1651
+ * ignore
1652
+ */
1653
+
1654
+ function handleArray(val, context) {
1655
+ const _this = this;
1656
+ if (!Array.isArray(val)) {
1657
+ return [this.castForQuery(null, val, context)];
1658
+ }
1659
+ return val.map(function(m) {
1660
+ return _this.castForQuery(null, m, context);
1661
+ });
1662
+ }
1663
+
1664
+ /**
1665
+ * Just like handleArray, except also allows `[]` because surprisingly
1666
+ * `$in: [1, []]` works fine
1667
+ * @api private
1668
+ */
1669
+
1670
+ function handle$in(val, context) {
1671
+ const _this = this;
1672
+ if (!Array.isArray(val)) {
1673
+ return [this.castForQuery(null, val, context)];
1674
+ }
1675
+ return val.map(function(m) {
1676
+ if (Array.isArray(m) && m.length === 0) {
1677
+ return m;
1678
+ }
1679
+ return _this.castForQuery(null, m, context);
1680
+ });
1681
+ }
1682
+
1683
+ /**
1684
+ * Contains the handlers for different query operators for this schema type.
1685
+ * For example, `$conditionalHandlers.$exists` is the function Mongoose calls to cast `$exists` filter operators.
1686
+ *
1687
+ * @property $conditionalHandlers
1688
+ * @memberOf SchemaType
1689
+ * @instance
1690
+ * @api public
1691
+ */
1692
+
1693
+ SchemaType.prototype.$conditionalHandlers = {
1694
+ $all: handleArray,
1695
+ $eq: handleSingle,
1696
+ $in: handle$in,
1697
+ $ne: handleSingle,
1698
+ $nin: handle$in,
1699
+ $exists: $exists,
1700
+ $type: $type
1701
+ };
1702
+
1703
+ /**
1704
+ * Cast the given value with the given optional query operator.
1705
+ *
1706
+ * @param {String} [$conditional] query operator, like `$eq` or `$in`
1707
+ * @param {Any} val
1708
+ * @param {Query} context
1709
+ * @return {Any}
1710
+ * @api private
1711
+ */
1712
+
1713
+ SchemaType.prototype.castForQuery = function($conditional, val, context) {
1714
+ let handler;
1715
+ if ($conditional != null) {
1716
+ handler = this.$conditionalHandlers[$conditional];
1717
+ if (!handler) {
1718
+ throw new Error('Can\'t use ' + $conditional);
1719
+ }
1720
+ return handler.call(this, val, context);
1721
+ }
1722
+
1723
+ try {
1724
+ return this.applySetters(val, context);
1725
+ } catch (err) {
1726
+ if (err instanceof CastError && err.path === this.path && this.$fullPath != null) {
1727
+ err.path = this.$fullPath;
1728
+ }
1729
+ throw err;
1730
+ }
1731
+ };
1732
+
1733
+ /**
1734
+ * Set & Get the `checkRequired` function
1735
+ * Override the function the required validator uses to check whether a value
1736
+ * passes the `required` check. Override this on the individual SchemaType.
1737
+ *
1738
+ * #### Example:
1739
+ *
1740
+ * // Use this to allow empty strings to pass the `required` validator
1741
+ * mongoose.Schema.Types.String.checkRequired(v => typeof v === 'string');
1742
+ *
1743
+ * @param {Function} [fn] If set, will overwrite the current set function
1744
+ * @return {Function} The input `fn` or the already set function
1745
+ * @static
1746
+ * @memberOf SchemaType
1747
+ * @function checkRequired
1748
+ * @api public
1749
+ */
1750
+
1751
+ SchemaType.checkRequired = function(fn) {
1752
+ if (arguments.length !== 0) {
1753
+ this._checkRequired = fn;
1754
+ }
1755
+
1756
+ return this._checkRequired;
1757
+ };
1758
+
1759
+ /**
1760
+ * Default check for if this path satisfies the `required` validator.
1761
+ *
1762
+ * @param {Any} val
1763
+ * @return {Boolean} `true` when the value is not `null`, `false` otherwise
1764
+ * @api private
1765
+ */
1766
+
1767
+ SchemaType.prototype.checkRequired = function(val) {
1768
+ return val != null;
1769
+ };
1770
+
1771
+ /**
1772
+ * Clone the current SchemaType
1773
+ *
1774
+ * @return {SchemaType} The cloned SchemaType instance
1775
+ * @api private
1776
+ */
1777
+
1778
+ SchemaType.prototype.clone = function() {
1779
+ const options = Object.assign({}, this.options);
1780
+ const schematype = new this.constructor(this.path, options, this.instance, this.parentSchema);
1781
+ schematype.validators = this.validators.slice();
1782
+ if (this.requiredValidator !== undefined) schematype.requiredValidator = this.requiredValidator;
1783
+ if (this.defaultValue !== undefined) schematype.defaultValue = this.defaultValue;
1784
+ if (this.$immutable !== undefined && this.options.immutable === undefined) {
1785
+ schematype.$immutable = this.$immutable;
1786
+
1787
+ handleImmutable(schematype);
1788
+ }
1789
+ if (this._index !== undefined) schematype._index = this._index;
1790
+ if (this.selected !== undefined) schematype.selected = this.selected;
1791
+ if (this.isRequired !== undefined) schematype.isRequired = this.isRequired;
1792
+ if (this.originalRequiredValue !== undefined) schematype.originalRequiredValue = this.originalRequiredValue;
1793
+ schematype.getters = this.getters.slice();
1794
+ schematype.setters = this.setters.slice();
1795
+ return schematype;
1796
+ };
1797
+
1798
+ /**
1799
+ * Returns the embedded schema type, if any. For arrays, document arrays, and maps, `getEmbeddedSchemaType()`
1800
+ * returns the schema type of the array's elements (or map's elements). For other types, `getEmbeddedSchemaType()`
1801
+ * returns `undefined`.
1802
+ *
1803
+ * #### Example:
1804
+ *
1805
+ * const schema = new Schema({ name: String, tags: [String] });
1806
+ * schema.path('name').getEmbeddedSchemaType(); // undefined
1807
+ * schema.path('tags').getEmbeddedSchemaType(); // SchemaString { path: 'tags', ... }
1808
+ *
1809
+ * @returns {SchemaType} embedded schematype
1810
+ * @api public
1811
+ */
1812
+
1813
+ SchemaType.prototype.getEmbeddedSchemaType = function getEmbeddedSchemaType() {
1814
+ return this.$embeddedSchemaType;
1815
+ };
1816
+
1817
+ /*!
1818
+ * If _duplicateKeyErrorMessage is a string, replace unique index errors "E11000 duplicate key error" with this string.
1819
+ *
1820
+ * @api private
1821
+ */
1822
+
1823
+ SchemaType.prototype._duplicateKeyErrorMessage = null;
1824
+
1825
+ /**
1826
+ * Returns this schema type's representation in a JSON schema.
1827
+ *
1828
+ * @param [options]
1829
+ * @param [options.useBsonType=false] If true, return a representation with `bsonType` for use with MongoDB's `$jsonSchema`.
1830
+ * @returns {Object} JSON schema properties
1831
+ */
1832
+
1833
+ SchemaType.prototype.toJSONSchema = function toJSONSchema(_options) { // eslint-disable-line no-unused-vars
1834
+ throw new Error(`Converting unsupported SchemaType to JSON Schema: ${this.instance} at path "${this.path}"`);
1835
+ };
1836
+
1837
+ /**
1838
+ * Returns the BSON type that the schema corresponds to, for automatic encryption.
1839
+ * @api private
1840
+ */
1841
+ SchemaType.prototype.autoEncryptionType = function autoEncryptionType() {
1842
+ return null;
1843
+ };
1844
+
1845
+ /*!
1846
+ * Module exports.
1847
+ */
1848
+
1849
+ module.exports = exports = SchemaType;
1850
+
1851
+ exports.CastError = CastError;
1852
+
1853
+ exports.ValidatorError = ValidatorError;