@nullix/zod-mongoose-studio 3.2.0 → 3.3.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 (118) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/_fonts/57NSSoFy1VLVs2gqly8Ls9awBnZMFyXGrefpmqvdqmc-zJfbBtpgM4cDmcXBsqZNW79_kFnlpPd62b48glgdydA.woff2 +0 -0
  3. package/.output/public/_fonts/8VR2wSMN-3U4NbWAVYXlkRV6hA0jFBXP-0RtL3X7fko-x2gYI4qfmkRdxyQQUPaBZdZdgl1TeVrquF_TxHeM4lM.woff2 +0 -0
  4. package/.output/public/_fonts/GsKUclqeNLJ96g5AU593ug6yanivOiwjW_7zESNPChw-jHA4tBeM1bjF7LATGUpfBuSTyomIFrWBTzjF7txVYfg.woff2 +0 -0
  5. package/.output/public/_fonts/Ld1FnTo3yTIwDyGfTQ5-Fws9AWsCbKfMvgxduXr7JcY-W25bL8NF1fjpLRSOgJb7RoZPHqGQNwMTM7S9tHVoxx8.woff2 +0 -0
  6. package/.output/public/_fonts/NdzqRASp2bovDUhQT1IRE_EMqKJ2KYQdTCfFcBvL8yw-KhwZiS86o3fErOe5GGMExHUemmI_dBfaEFxjISZrBd0.woff2 +0 -0
  7. package/.output/public/_fonts/iTkrULNFJJkTvihIg1Vqi5IODRH_9btXCioVF5l98I8-AndUyau2HR2felA_ra8V2mutQgschhasE5FD1dXGJX8.woff2 +0 -0
  8. package/.output/public/_nuxt/{qQyvCkbV.js → 5Tu2WUJz.js} +1 -1
  9. package/.output/public/_nuxt/B0N6xv5E.js +1 -0
  10. package/.output/public/_nuxt/{DjPT-NCE.js → B0cUlOSM.js} +1 -1
  11. package/.output/public/_nuxt/B9paGgN0.js +33 -0
  12. package/.output/public/_nuxt/{IxYCG8hB.js → BCIlnd0g.js} +1 -1
  13. package/.output/public/_nuxt/{ikxafTHA.js → BNDnV2op.js} +180 -184
  14. package/.output/public/_nuxt/{Ce-T_1aD.js → BO4hqv6q.js} +1 -1
  15. package/.output/public/_nuxt/{Bd32GOUy.js → BOsJJ_ZU.js} +1 -1
  16. package/.output/public/_nuxt/{BzhSDy30.js → C2BHp-MG.js} +1 -1
  17. package/.output/public/_nuxt/{Cs8GXJCB.js → CKULsFUz.js} +1 -1
  18. package/.output/public/_nuxt/CMH9iX_E.js +6 -0
  19. package/.output/public/_nuxt/{tzj4nvDE.js → CzbCpNnc.js} +2 -2
  20. package/.output/public/_nuxt/{CC3n3Aga.js → D87QMS6j.js} +1 -1
  21. package/.output/public/_nuxt/DA0pQuyP.js +27 -0
  22. package/.output/public/_nuxt/{B7P0wQ35.js → DcJ7oPvZ.js} +1 -1
  23. package/.output/public/_nuxt/{Ick_23I4.js → Dce9SnGa.js} +1 -1
  24. package/.output/public/_nuxt/{CAd-qHfI.js → DpKrXpkK.js} +1 -1
  25. package/.output/public/_nuxt/DsnIpnT9.js +1 -0
  26. package/.output/public/_nuxt/{CNZorjDf.js → I3Ucam2s.js} +1 -1
  27. package/.output/public/_nuxt/builds/latest.json +1 -1
  28. package/.output/public/_nuxt/builds/meta/51f1351c-0667-4235-9ddc-16582a51ce03.json +1 -0
  29. package/.output/public/_nuxt/{entry.J_CbC0oY.css → entry.B-vs1tRH.css} +1 -1
  30. package/.output/public/_nuxt/error-404.CTSXlFYa.css +1 -0
  31. package/.output/public/_nuxt/error-500.DqEfQnVZ.css +1 -0
  32. package/.output/public/_nuxt/{nDZOJ7rN.js → o-NCh2rp.js} +2 -2
  33. package/.output/public/_nuxt/{qwxNOyg7.js → sKEJiAHO.js} +1 -1
  34. package/.output/public/_nuxt/{81vqh61j.js → tqQNlhT9.js} +1 -1
  35. package/.output/public/_nuxt/ypRHVLFO.js +1 -0
  36. package/.output/server/chunks/_/error-500.mjs.map +1 -1
  37. package/.output/server/chunks/build/client.precomputed.mjs +1 -1
  38. package/.output/server/chunks/build/{error-404-BN-7rNE4.mjs → error-404-KRkA0DPI.mjs} +10 -4
  39. package/.output/server/chunks/build/error-404-KRkA0DPI.mjs.map +1 -0
  40. package/.output/server/chunks/build/error-404-styles.I0NYw-Bn.mjs +8 -0
  41. package/.output/server/chunks/build/error-404-styles.I0NYw-Bn.mjs.map +1 -0
  42. package/.output/server/chunks/build/{error-500-DhIQ-2yt.mjs → error-500-DIIFf55p.mjs} +10 -4
  43. package/.output/server/chunks/build/error-500-DIIFf55p.mjs.map +1 -0
  44. package/.output/server/chunks/build/error-500-styles.D1cs9hQy.mjs +8 -0
  45. package/.output/server/chunks/build/error-500-styles.D1cs9hQy.mjs.map +1 -0
  46. package/.output/server/chunks/build/index-CB1N4gax.mjs +557 -0
  47. package/.output/server/chunks/build/index-CB1N4gax.mjs.map +1 -0
  48. package/.output/server/chunks/build/server.mjs +326 -248
  49. package/.output/server/chunks/build/server.mjs.map +1 -1
  50. package/.output/server/chunks/build/styles.mjs +4 -4
  51. package/.output/server/chunks/nitro/nitro.mjs +2302 -835
  52. package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
  53. package/.output/server/chunks/routes/api/editor-types.get.mjs +44 -0
  54. package/.output/server/chunks/routes/api/editor-types.get.mjs.map +1 -0
  55. package/.output/server/chunks/routes/api/parse.post.mjs +26 -1316
  56. package/.output/server/chunks/routes/api/parse.post.mjs.map +1 -1
  57. package/.output/server/chunks/routes/api/resolve.get.mjs +6 -0
  58. package/.output/server/chunks/routes/api/resolve.get.mjs.map +1 -1
  59. package/.output/server/chunks/routes/api/studio/run.post.mjs +35 -0
  60. package/.output/server/chunks/routes/api/studio/run.post.mjs.map +1 -0
  61. package/.output/server/chunks/routes/renderer.mjs +1 -1
  62. package/.output/server/chunks/routes/renderer.mjs.map +1 -1
  63. package/.output/server/index.mjs +7 -1
  64. package/.output/server/index.mjs.map +1 -1
  65. package/.output/server/node_modules/acorn/dist/acorn.mjs +6266 -0
  66. package/.output/server/node_modules/acorn/package.json +50 -0
  67. package/.output/server/node_modules/ip-address/dist/common.js +112 -4
  68. package/.output/server/node_modules/ip-address/dist/ipv4.js +322 -87
  69. package/.output/server/node_modules/ip-address/dist/ipv6.js +654 -199
  70. package/.output/server/node_modules/ip-address/dist/v4/constants.js +45 -2
  71. package/.output/server/node_modules/ip-address/dist/v6/constants.js +55 -3
  72. package/.output/server/node_modules/ip-address/dist/v6/helpers.js +12 -3
  73. package/.output/server/node_modules/ip-address/package.json +49 -37
  74. package/.output/server/node_modules/ufo/dist/index.mjs +2 -2
  75. package/.output/server/node_modules/ufo/package.json +9 -9
  76. package/.output/server/package.json +4 -3
  77. package/README.md +62 -19
  78. package/app/assets/css/main.css +1 -0
  79. package/app/assets/css/studio.css +131 -0
  80. package/app/components/StudioConversion.vue +41 -0
  81. package/app/components/StudioDataPanel.vue +21 -0
  82. package/app/components/StudioEditor.vue +78 -102
  83. package/app/components/StudioExpandButton.vue +11 -0
  84. package/app/components/StudioOutput.vue +7 -1
  85. package/app/components/StudioSourcePanel.vue +16 -0
  86. package/app/components/StudioValidation.vue +47 -0
  87. package/app/components/ZodMongooseStudio.vue +216 -198
  88. package/app/composables/useStudioRunner.ts +142 -0
  89. package/app/pages/index.vue +1 -1
  90. package/app/plugins/monaco.client.ts +2 -0
  91. package/bin/index.mjs +5 -0
  92. package/nuxt.config.ts +4 -3
  93. package/package.json +4 -2
  94. package/server/api/editor-types.get.ts +28 -0
  95. package/server/api/parse.post.ts +17 -175
  96. package/server/api/studio/run.post.ts +17 -0
  97. package/server/middleware/security.ts +29 -7
  98. package/server/utils/example-data.ts +80 -0
  99. package/server/utils/parse-request.ts +28 -0
  100. package/server/utils/runner-client.ts +40 -0
  101. package/server/utils/studio-execution.ts +176 -0
  102. package/.output/public/_nuxt/BD40YYqZ.js +0 -33
  103. package/.output/public/_nuxt/BlQmLjV4.js +0 -1
  104. package/.output/public/_nuxt/CJ4Cv9fY.js +0 -61
  105. package/.output/public/_nuxt/builds/meta/34871c14-b0f4-4898-9ff0-debaff743355.json +0 -1
  106. package/.output/public/_nuxt/error-404.64pZEiDn.css +0 -1
  107. package/.output/public/_nuxt/error-500.DHOpI0Ir.css +0 -1
  108. package/.output/public/_nuxt/rH_O4qXT.js +0 -1
  109. package/.output/server/chunks/build/error-404-BN-7rNE4.mjs.map +0 -1
  110. package/.output/server/chunks/build/error-404-styles.Byx46oLR.mjs +0 -8
  111. package/.output/server/chunks/build/error-404-styles.Byx46oLR.mjs.map +0 -1
  112. package/.output/server/chunks/build/error-500-DhIQ-2yt.mjs.map +0 -1
  113. package/.output/server/chunks/build/error-500-styles.BL3UT0Wa.mjs +0 -8
  114. package/.output/server/chunks/build/error-500-styles.BL3UT0Wa.mjs.map +0 -1
  115. package/.output/server/chunks/build/index-B4T6zHp0.mjs +0 -1904
  116. package/.output/server/chunks/build/index-B4T6zHp0.mjs.map +0 -1
  117. package/.output/server/node_modules/zod/index.js +0 -4
  118. /package/.output/public/_nuxt/{editor.CdBKkuhR.css → monaco.CdBKkuhR.css} +0 -0
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "acorn",
3
+ "description": "ECMAScript parser",
4
+ "homepage": "https://github.com/acornjs/acorn",
5
+ "main": "dist/acorn.js",
6
+ "types": "dist/acorn.d.ts",
7
+ "module": "dist/acorn.mjs",
8
+ "exports": {
9
+ ".": [
10
+ {
11
+ "import": "./dist/acorn.mjs",
12
+ "require": "./dist/acorn.js",
13
+ "default": "./dist/acorn.js"
14
+ },
15
+ "./dist/acorn.js"
16
+ ],
17
+ "./package.json": "./package.json"
18
+ },
19
+ "version": "8.16.0",
20
+ "engines": {
21
+ "node": ">=0.4.0"
22
+ },
23
+ "maintainers": [
24
+ {
25
+ "name": "Marijn Haverbeke",
26
+ "email": "marijnh@gmail.com",
27
+ "web": "https://marijnhaverbeke.nl"
28
+ },
29
+ {
30
+ "name": "Ingvar Stepanyan",
31
+ "email": "me@rreverser.com",
32
+ "web": "https://rreverser.com/"
33
+ },
34
+ {
35
+ "name": "Adrian Heine",
36
+ "web": "http://adrianheine.de"
37
+ }
38
+ ],
39
+ "repository": {
40
+ "type": "git",
41
+ "url": "git+https://github.com/acornjs/acorn.git"
42
+ },
43
+ "license": "MIT",
44
+ "scripts": {
45
+ "prepare": "cd ..; npm run build:main"
46
+ },
47
+ "bin": {
48
+ "acorn": "bin/acorn"
49
+ }
50
+ }
@@ -1,21 +1,95 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isInSubnet = isInSubnet;
4
+ exports.isHostInSubnet = isHostInSubnet;
5
+ exports.isGloballyReachable = isGloballyReachable;
6
+ exports.offsetBigInt = offsetBigInt;
4
7
  exports.isCorrect = isCorrect;
8
+ exports.prefixLengthFromMask = prefixLengthFromMask;
9
+ exports.assertByteArray = assertByteArray;
5
10
  exports.numberToPaddedHex = numberToPaddedHex;
6
11
  exports.stringToPaddedHex = stringToPaddedHex;
7
12
  exports.testBit = testBit;
13
+ const address_error_1 = require("./address-error");
14
+ /**
15
+ * Returns whether this address's *network* is contained within `address`,
16
+ * i.e. whether every address this one can represent also falls inside
17
+ * `address`. A network wider than `address` is not contained in it, so
18
+ * `10.0.0.0/8` is not in `10.0.0.0/16`.
19
+ *
20
+ * To ask whether the address itself falls inside a range, ignoring any CIDR
21
+ * suffix it was written with, use {@link isHostInSubnet} instead. That is the
22
+ * question the special-use classifiers ask.
23
+ */
8
24
  function isInSubnet(address) {
9
25
  if (this.subnetMask < address.subnetMask) {
10
26
  return false;
11
27
  }
12
- if (this.mask(address.subnetMask) === address.mask()) {
13
- return true;
28
+ return isHostInSubnet.call(this, address);
29
+ }
30
+ /**
31
+ * Returns whether this address's host bits fall inside `address`, ignoring
32
+ * this address's own subnet mask.
33
+ *
34
+ * This is the primitive the special-use classifiers (`isLoopback`,
35
+ * `isPrivate`, `isLinkLocal`, `getType`, …) are built on: they answer a
36
+ * question about the address, so the answer must not change with the CIDR
37
+ * suffix the caller happened to write. Use this rather than
38
+ * {@link isInSubnet} when classifying a single address — notably when the
39
+ * address came from untrusted input and the result backs a trust-boundary
40
+ * decision such as an SSRF allow/deny filter.
41
+ *
42
+ * An address of one family is never inside a network of the other, so an
43
+ * `Address4` against an `Address6` (or the reverse) is `false`. To compare
44
+ * across families, convert first: `Address6.fromAddress4()`, `to4()`, or
45
+ * `toAddress4Nat64()`.
46
+ */
47
+ function isHostInSubnet(address) {
48
+ // mask() is a bit string of the family's width, and the leading bits of a
49
+ // 32-bit string can coincide with those of a 128-bit one (a00::1 and
50
+ // 10.0.0.0/8 both mask to 00001010), so the widths must agree before the
51
+ // strings are compared.
52
+ if (this.binaryZeroPad().length !== address.binaryZeroPad().length) {
53
+ return false;
14
54
  }
15
- return false;
55
+ return this.mask(address.subnetMask) === address.mask();
56
+ }
57
+ /**
58
+ * Returns whether the registry marks this address globally reachable: the
59
+ * answer of the most specific entry containing it that has one, or `true`
60
+ * when no entry contains it.
61
+ */
62
+ function isGloballyReachable(entries) {
63
+ let best = null;
64
+ for (let i = 0; i < entries.length; i++) {
65
+ const entry = entries[i];
66
+ if (entry.reachable !== null &&
67
+ isHostInSubnet.call(this, entry.subnet) &&
68
+ (best === null || entry.subnet.subnetMask > best.subnet.subnetMask)) {
69
+ best = entry;
70
+ }
71
+ }
72
+ return best === null ? true : best.reachable;
73
+ }
74
+ /**
75
+ * Adds `n` to `value` and returns the result, throwing `AddressError` unless
76
+ * `n` is an integer and the result stays within `[0, 2**bits - 1]`.
77
+ */
78
+ function offsetBigInt(value, n, bits, family) {
79
+ if (typeof n === 'number' && !Number.isSafeInteger(n)) {
80
+ throw new address_error_1.AddressError(`${family} offset must be an integer`);
81
+ }
82
+ if (typeof n !== 'number' && typeof n !== 'bigint') {
83
+ throw new address_error_1.AddressError(`${family} offset must be an integer`);
84
+ }
85
+ const result = value + BigInt(n);
86
+ if (result < BigInt(0) || result > (BigInt(1) << BigInt(bits)) - BigInt(1)) {
87
+ throw new address_error_1.AddressError(`${family} offset leaves the address space`);
88
+ }
89
+ return result;
16
90
  }
17
91
  function isCorrect(defaultBits) {
18
- return function () {
92
+ return function isCorrectForm() {
19
93
  if (this.addressMinusSuffix !== this.correctForm()) {
20
94
  return false;
21
95
  }
@@ -25,6 +99,40 @@ function isCorrect(defaultBits) {
25
99
  return this.parsedSubnet === String(this.subnetMask);
26
100
  };
27
101
  }
102
+ /**
103
+ * Returns the prefix length (number of leading 1 bits) of a contiguous
104
+ * subnet mask. Throws `AddressError` if the mask is non-contiguous (e.g.
105
+ * `255.0.255.0`).
106
+ */
107
+ function prefixLengthFromMask(value, totalBits) {
108
+ const binary = value.toString(2).padStart(totalBits, '0');
109
+ if (binary.length > totalBits) {
110
+ throw new address_error_1.AddressError('Invalid subnet mask.');
111
+ }
112
+ const firstZero = binary.indexOf('0');
113
+ if (firstZero === -1) {
114
+ return totalBits;
115
+ }
116
+ if (binary.slice(firstZero).includes('1')) {
117
+ throw new address_error_1.AddressError('Invalid subnet mask.');
118
+ }
119
+ return firstZero;
120
+ }
121
+ /**
122
+ * Throws `AddressError` unless `bytes` holds exactly `byteCount` integers,
123
+ * each from `minimum` to 255. Pass a `minimum` of `-128` where signed bytes
124
+ * are accepted and folded to unsigned, and `0` where they are not.
125
+ */
126
+ function assertByteArray(bytes, byteCount, family, minimum) {
127
+ if (bytes.length !== byteCount) {
128
+ throw new address_error_1.AddressError(`${family} addresses require exactly ${byteCount} bytes`);
129
+ }
130
+ for (let i = 0; i < bytes.length; i++) {
131
+ if (!Number.isInteger(bytes[i]) || bytes[i] < minimum || bytes[i] > 255) {
132
+ throw new address_error_1.AddressError(`All bytes must be integers between ${minimum} and 255`);
133
+ }
134
+ }
135
+ }
28
136
  function numberToPaddedHex(number) {
29
137
  return number.toString(16).padStart(2, '0');
30
138
  }