@zuplo/cli 6.70.31 → 6.70.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/middleware/check-pnpm-lifecycle.test.js.map +1 -1
- package/node_modules/@zuplo/core/package.json +1 -1
- package/node_modules/@zuplo/graphql/package.json +1 -1
- package/node_modules/@zuplo/openapi-tools/package.json +1 -1
- package/node_modules/@zuplo/otel/package.json +1 -1
- package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js +19 -19
- package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js.map +1 -1
- package/node_modules/@zuplo/runtime/package.json +1 -1
- package/node_modules/hono/dist/cjs/hono-base.js +9 -4
- package/node_modules/hono/dist/cjs/middleware/ip-restriction/index.js +58 -28
- package/node_modules/hono/dist/cjs/middleware/jwk/jwk.js +1 -1
- package/node_modules/hono/dist/cjs/middleware/jwt/jwt.js +1 -1
- package/node_modules/hono/dist/cjs/utils/cookie.js +1 -1
- package/node_modules/hono/dist/cjs/utils/ipaddr.js +186 -8
- package/node_modules/hono/dist/hono-base.js +9 -4
- package/node_modules/hono/dist/middleware/ip-restriction/index.js +60 -29
- package/node_modules/hono/dist/middleware/jwk/jwk.js +1 -1
- package/node_modules/hono/dist/middleware/jwt/jwt.js +1 -1
- package/node_modules/hono/dist/tsconfig.build.tsbuildinfo +1 -1
- package/node_modules/hono/dist/types/jsx/base.d.ts +2 -2
- package/node_modules/hono/dist/types/jsx/index.d.ts +1 -1
- package/node_modules/hono/dist/types/utils/ipaddr.d.ts +4 -0
- package/node_modules/hono/dist/utils/cookie.js +1 -1
- package/node_modules/hono/dist/utils/ipaddr.js +185 -8
- package/node_modules/hono/package.json +1 -1
- package/node_modules/protobufjs/README.md +1 -1
- package/node_modules/protobufjs/dist/light/protobuf.js +8 -6
- package/node_modules/protobufjs/dist/light/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/light/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/light/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/dist/minimal/protobuf.js +2 -2
- package/node_modules/protobufjs/dist/minimal/protobuf.min.js +2 -2
- package/node_modules/protobufjs/dist/protobuf.js +8 -6
- package/node_modules/protobufjs/dist/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/index.d.ts +2 -1
- package/node_modules/protobufjs/package.json +2 -2
- package/node_modules/protobufjs/src/converter.js +5 -3
- package/node_modules/protobufjs/src/type.js +1 -1
- package/package.json +6 -6
|
@@ -22,6 +22,16 @@ var expandIPv6 = (ipV6) => {
|
|
|
22
22
|
};
|
|
23
23
|
var IPV4_OCTET_PART = "(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])";
|
|
24
24
|
var IPV4_REGEX = new RegExp(`^(?:${IPV4_OCTET_PART}\\.){3}${IPV4_OCTET_PART}$`);
|
|
25
|
+
var INVALID_IP_ADDRESS_ERROR_CODE = "ERR_INVALID_IP_ADDRESS";
|
|
26
|
+
var CHAR_CODE_0 = 48;
|
|
27
|
+
var CHAR_CODE_9 = 57;
|
|
28
|
+
var CHAR_CODE_A = 65;
|
|
29
|
+
var CHAR_CODE_F = 70;
|
|
30
|
+
var CHAR_CODE_a = 97;
|
|
31
|
+
var CHAR_CODE_f = 102;
|
|
32
|
+
var CHAR_CODE_DOT = 46;
|
|
33
|
+
var CHAR_CODE_COLON = 58;
|
|
34
|
+
var CHAR_CODE_PERCENT = 37;
|
|
25
35
|
var distinctRemoteAddr = (remoteAddr) => {
|
|
26
36
|
if (IPV4_REGEX.test(remoteAddr)) {
|
|
27
37
|
return "IPv4";
|
|
@@ -30,21 +40,187 @@ var distinctRemoteAddr = (remoteAddr) => {
|
|
|
30
40
|
return "IPv6";
|
|
31
41
|
}
|
|
32
42
|
};
|
|
33
|
-
var
|
|
34
|
-
const
|
|
43
|
+
var createInvalidIPAddressError = (message) => {
|
|
44
|
+
const error = new TypeError(message);
|
|
45
|
+
error.code = INVALID_IP_ADDRESS_ERROR_CODE;
|
|
46
|
+
return error;
|
|
47
|
+
};
|
|
48
|
+
var throwInvalidIPv4Address = (ipv4) => {
|
|
49
|
+
throw createInvalidIPAddressError(`Invalid IPv4 address: ${ipv4}`);
|
|
50
|
+
};
|
|
51
|
+
var throwInvalidIPv6Address = (ipv6) => {
|
|
52
|
+
throw createInvalidIPAddressError(`Invalid IPv6 address: ${ipv6}`);
|
|
53
|
+
};
|
|
54
|
+
var parseIPv4ToBinary = (ipv4, start, end, onInvalid) => {
|
|
35
55
|
let result = 0n;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
56
|
+
let octets = 0;
|
|
57
|
+
let octet = 0;
|
|
58
|
+
let digits = 0;
|
|
59
|
+
let firstDigit = 0;
|
|
60
|
+
for (let i = start; i <= end; i++) {
|
|
61
|
+
const code = i < end ? ipv4.charCodeAt(i) : CHAR_CODE_DOT;
|
|
62
|
+
if (code >= CHAR_CODE_0 && code <= CHAR_CODE_9) {
|
|
63
|
+
if (digits === 0) {
|
|
64
|
+
firstDigit = code;
|
|
65
|
+
} else if (firstDigit === CHAR_CODE_0) {
|
|
66
|
+
onInvalid();
|
|
67
|
+
}
|
|
68
|
+
octet = octet * 10 + code - CHAR_CODE_0;
|
|
69
|
+
if (octet > 255) {
|
|
70
|
+
onInvalid();
|
|
71
|
+
}
|
|
72
|
+
digits++;
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
if (code !== CHAR_CODE_DOT || digits === 0 || octets === 4) {
|
|
76
|
+
onInvalid();
|
|
77
|
+
}
|
|
78
|
+
result = (result << 8n) + BigInt(octet);
|
|
79
|
+
octets++;
|
|
80
|
+
octet = 0;
|
|
81
|
+
digits = 0;
|
|
82
|
+
}
|
|
83
|
+
if (octets !== 4) {
|
|
84
|
+
onInvalid();
|
|
39
85
|
}
|
|
40
86
|
return result;
|
|
41
87
|
};
|
|
88
|
+
var parseIPv6HexCode = (code) => {
|
|
89
|
+
if (code >= CHAR_CODE_0 && code <= CHAR_CODE_9) {
|
|
90
|
+
return code - CHAR_CODE_0;
|
|
91
|
+
}
|
|
92
|
+
if (code >= CHAR_CODE_A && code <= CHAR_CODE_F) {
|
|
93
|
+
return code - CHAR_CODE_A + 10;
|
|
94
|
+
}
|
|
95
|
+
if (code >= CHAR_CODE_a && code <= CHAR_CODE_f) {
|
|
96
|
+
return code - CHAR_CODE_a + 10;
|
|
97
|
+
}
|
|
98
|
+
return -1;
|
|
99
|
+
};
|
|
100
|
+
var isIPv6LinkLocal = (ipv6binary) => ipv6binary >> 118n === 0x3fan;
|
|
101
|
+
var convertIPv4ToBinary = (ipv4) => {
|
|
102
|
+
return parseIPv4ToBinary(ipv4, 0, ipv4.length, () => throwInvalidIPv4Address(ipv4));
|
|
103
|
+
};
|
|
42
104
|
var convertIPv6ToBinary = (ipv6) => {
|
|
43
|
-
const
|
|
105
|
+
const length = ipv6.length;
|
|
106
|
+
const sections = [];
|
|
107
|
+
let hasZoneId = false;
|
|
108
|
+
let compressAt = -1;
|
|
109
|
+
let index = 0;
|
|
110
|
+
if (length === 0) {
|
|
111
|
+
throwInvalidIPv6Address(ipv6);
|
|
112
|
+
}
|
|
113
|
+
while (index < length) {
|
|
114
|
+
if (sections.length > 8) {
|
|
115
|
+
throwInvalidIPv6Address(ipv6);
|
|
116
|
+
}
|
|
117
|
+
let code = ipv6.charCodeAt(index);
|
|
118
|
+
if (code === CHAR_CODE_PERCENT) {
|
|
119
|
+
if (index + 1 === length) {
|
|
120
|
+
throwInvalidIPv6Address(ipv6);
|
|
121
|
+
}
|
|
122
|
+
hasZoneId = true;
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
if (code === CHAR_CODE_COLON) {
|
|
126
|
+
if (index + 1 < length && ipv6.charCodeAt(index + 1) === CHAR_CODE_COLON) {
|
|
127
|
+
if (compressAt !== -1) {
|
|
128
|
+
throwInvalidIPv6Address(ipv6);
|
|
129
|
+
}
|
|
130
|
+
compressAt = sections.length;
|
|
131
|
+
index += 2;
|
|
132
|
+
continue;
|
|
133
|
+
}
|
|
134
|
+
throwInvalidIPv6Address(ipv6);
|
|
135
|
+
}
|
|
136
|
+
let value = 0;
|
|
137
|
+
let digits = 0;
|
|
138
|
+
const sectionStart = index;
|
|
139
|
+
while (index < length) {
|
|
140
|
+
code = ipv6.charCodeAt(index);
|
|
141
|
+
const hex = parseIPv6HexCode(code);
|
|
142
|
+
if (hex === -1) {
|
|
143
|
+
break;
|
|
144
|
+
}
|
|
145
|
+
if (digits === 4) {
|
|
146
|
+
throwInvalidIPv6Address(ipv6);
|
|
147
|
+
}
|
|
148
|
+
value = value << 4 | hex;
|
|
149
|
+
digits++;
|
|
150
|
+
index++;
|
|
151
|
+
}
|
|
152
|
+
if (index < length && ipv6.charCodeAt(index) === CHAR_CODE_DOT) {
|
|
153
|
+
let ipv4End = length;
|
|
154
|
+
for (let i = index; i < length; i++) {
|
|
155
|
+
if (ipv6.charCodeAt(i) === CHAR_CODE_PERCENT) {
|
|
156
|
+
if (i + 1 === length) {
|
|
157
|
+
throwInvalidIPv6Address(ipv6);
|
|
158
|
+
}
|
|
159
|
+
hasZoneId = true;
|
|
160
|
+
ipv4End = i;
|
|
161
|
+
break;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
const ipv4 = parseIPv4ToBinary(
|
|
165
|
+
ipv6,
|
|
166
|
+
sectionStart,
|
|
167
|
+
ipv4End,
|
|
168
|
+
() => throwInvalidIPv6Address(ipv6)
|
|
169
|
+
);
|
|
170
|
+
sections.push(Number(ipv4 >> 16n & 0xffffn), Number(ipv4 & 0xffffn));
|
|
171
|
+
index = length;
|
|
172
|
+
break;
|
|
173
|
+
}
|
|
174
|
+
if (digits === 0) {
|
|
175
|
+
throwInvalidIPv6Address(ipv6);
|
|
176
|
+
}
|
|
177
|
+
sections.push(value);
|
|
178
|
+
if (index === length) {
|
|
179
|
+
break;
|
|
180
|
+
}
|
|
181
|
+
code = ipv6.charCodeAt(index);
|
|
182
|
+
if (code === CHAR_CODE_PERCENT) {
|
|
183
|
+
if (index + 1 === length) {
|
|
184
|
+
throwInvalidIPv6Address(ipv6);
|
|
185
|
+
}
|
|
186
|
+
hasZoneId = true;
|
|
187
|
+
break;
|
|
188
|
+
}
|
|
189
|
+
if (code !== CHAR_CODE_COLON) {
|
|
190
|
+
throwInvalidIPv6Address(ipv6);
|
|
191
|
+
}
|
|
192
|
+
if (index + 1 < length && ipv6.charCodeAt(index + 1) === CHAR_CODE_COLON) {
|
|
193
|
+
if (compressAt !== -1) {
|
|
194
|
+
throwInvalidIPv6Address(ipv6);
|
|
195
|
+
}
|
|
196
|
+
compressAt = sections.length;
|
|
197
|
+
index += 2;
|
|
198
|
+
continue;
|
|
199
|
+
}
|
|
200
|
+
index++;
|
|
201
|
+
if (index === length) {
|
|
202
|
+
throwInvalidIPv6Address(ipv6);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
if (compressAt === -1 ? sections.length !== 8 : sections.length >= 8) {
|
|
206
|
+
throwInvalidIPv6Address(ipv6);
|
|
207
|
+
}
|
|
44
208
|
let result = 0n;
|
|
45
|
-
|
|
209
|
+
const zeros = compressAt === -1 ? 0 : 8 - sections.length;
|
|
210
|
+
const firstSectionEnd = compressAt === -1 ? sections.length : compressAt;
|
|
211
|
+
for (let i = 0; i < firstSectionEnd; i++) {
|
|
46
212
|
result <<= 16n;
|
|
47
|
-
result += BigInt(
|
|
213
|
+
result += BigInt(sections[i]);
|
|
214
|
+
}
|
|
215
|
+
for (let i = 0; i < zeros; i++) {
|
|
216
|
+
result <<= 16n;
|
|
217
|
+
}
|
|
218
|
+
for (let i = firstSectionEnd; i < sections.length; i++) {
|
|
219
|
+
result <<= 16n;
|
|
220
|
+
result += BigInt(sections[i]);
|
|
221
|
+
}
|
|
222
|
+
if (hasZoneId && !isIPv6LinkLocal(result)) {
|
|
223
|
+
throwInvalidIPv6Address(ipv6);
|
|
48
224
|
}
|
|
49
225
|
return result;
|
|
50
226
|
};
|
|
@@ -95,6 +271,7 @@ var convertIPv6BinaryToString = (ipV6) => {
|
|
|
95
271
|
return sections.join(":").replace(/:{2,}/g, "::");
|
|
96
272
|
};
|
|
97
273
|
export {
|
|
274
|
+
INVALID_IP_ADDRESS_ERROR_CODE,
|
|
98
275
|
convertIPv4BinaryToString,
|
|
99
276
|
convertIPv4MappedIPv6ToIPv4,
|
|
100
277
|
convertIPv4ToBinary,
|
|
@@ -184,7 +184,7 @@ With that in mind and again for performance reasons, each message class provides
|
|
|
184
184
|
```js
|
|
185
185
|
var object = AwesomeMessage.toObject(message, {
|
|
186
186
|
enums: String, // enums as string names
|
|
187
|
-
longs: String, // longs as strings (
|
|
187
|
+
longs: String, // longs as strings (or BigInt for bigint values)
|
|
188
188
|
bytes: String, // bytes as base64 encoded strings
|
|
189
189
|
defaults: true, // includes default values
|
|
190
190
|
arrays: true, // populates empty arrays (repeated fields) even if defaults=false
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* protobuf.js v7.
|
|
3
|
-
* compiled
|
|
2
|
+
* protobuf.js v7.6.0 (c) 2016, daniel wirtz
|
|
3
|
+
* compiled mon, 18 may 2026 18:11:08 utc
|
|
4
4
|
* licensed under the bsd-3-clause license
|
|
5
5
|
* see: https://github.com/dcodeio/protobuf.js for details
|
|
6
6
|
*/
|
|
@@ -1343,7 +1343,9 @@ function genValuePartial_toObject(gen, field, fieldIndex, prop) {
|
|
|
1343
1343
|
case "sint64":
|
|
1344
1344
|
case "fixed64":
|
|
1345
1345
|
case "sfixed64": gen
|
|
1346
|
-
("if(typeof
|
|
1346
|
+
("if(typeof BigInt!==\"undefined\"&&o.longs===BigInt)")
|
|
1347
|
+
("d%s=typeof m%s===\"number\"?BigInt(m%s):util.Long.fromBits(m%s.low>>>0,m%s.high>>>0,%j).toBigInt()", prop, prop, prop, prop, prop, isUnsigned)
|
|
1348
|
+
("else if(typeof m%s===\"number\")", prop)
|
|
1347
1349
|
("d%s=o.longs===String?String(m%s):m%s", prop, prop, prop)
|
|
1348
1350
|
("else") // Long-like
|
|
1349
1351
|
("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s", prop, prop, prop, prop, isUnsigned ? "true": "", prop);
|
|
@@ -1411,9 +1413,9 @@ converter.toObject = function toObject(mtype) {
|
|
|
1411
1413
|
else if (field.long) gen
|
|
1412
1414
|
("if(util.Long){")
|
|
1413
1415
|
("var n=new util.Long(%i,%i,%j)", field.typeDefault.low, field.typeDefault.high, field.typeDefault.unsigned)
|
|
1414
|
-
("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n", prop)
|
|
1416
|
+
("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():typeof BigInt!==\"undefined\"&&o.longs===BigInt?n.toBigInt():n", prop)
|
|
1415
1417
|
("}else")
|
|
1416
|
-
("d%s=o.longs===String?%j:%i", prop, field.typeDefault.toString(), field.typeDefault.toNumber());
|
|
1418
|
+
("d%s=o.longs===String?%j:typeof BigInt!==\"undefined\"&&o.longs===BigInt?BigInt(%j):%i", prop, field.typeDefault.toString(), field.typeDefault.toString(), field.typeDefault.toNumber());
|
|
1417
1419
|
else if (field.bytes) {
|
|
1418
1420
|
var arrayDefault = Array.prototype.slice.call(field.typeDefault);
|
|
1419
1421
|
gen
|
|
@@ -6003,7 +6005,7 @@ Type.prototype.fromObject = function fromObject(object, depth) {
|
|
|
6003
6005
|
* Conversion options as used by {@link Type#toObject} and {@link Message.toObject}.
|
|
6004
6006
|
* @interface IConversionOptions
|
|
6005
6007
|
* @property {Function} [longs] Long conversion type.
|
|
6006
|
-
* Valid values are `String` and `Number` (the global types).
|
|
6008
|
+
* Valid values are `BigInt`, `String` and `Number` (the global types).
|
|
6007
6009
|
* Defaults to copy the present value, which is a possibly unsafe number without and a {@link Long} with a long library.
|
|
6008
6010
|
* @property {Function} [enums] Enum value conversion type.
|
|
6009
6011
|
* Only valid value is `String` (the global type).
|