@psnext/slingcli 2.4.20260520-5 → 2.4.20260521-2
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/node_modules/@aws-sdk/core/package.json +5 -5
- package/node_modules/@aws-sdk/credential-provider-env/package.json +5 -5
- package/node_modules/@aws-sdk/credential-provider-http/package.json +7 -7
- package/node_modules/@aws-sdk/credential-provider-ini/package.json +12 -12
- package/node_modules/@aws-sdk/credential-provider-login/package.json +6 -6
- package/node_modules/@aws-sdk/credential-provider-node/package.json +10 -10
- package/node_modules/@aws-sdk/credential-provider-process/package.json +5 -5
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/package.json +6 -6
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +7 -7
- package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +6 -6
- package/node_modules/@aws-sdk/eventstream-handler-node/package.json +4 -4
- package/node_modules/@aws-sdk/middleware-eventstream/package.json +4 -4
- package/node_modules/@aws-sdk/middleware-websocket/package.json +6 -6
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/package.json +8 -8
- package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +4 -4
- package/node_modules/@aws-sdk/types/package.json +2 -2
- package/node_modules/@aws-sdk/xml-builder/package.json +2 -2
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.js +213 -207
- package/node_modules/@earendil-works/pi-ai/package.json +2 -2
- package/node_modules/@protobufjs/eventemitter/CHANGELOG.md +8 -0
- package/node_modules/@protobufjs/eventemitter/index.d.ts +10 -8
- package/node_modules/@protobufjs/eventemitter/index.js +17 -7
- package/node_modules/@protobufjs/eventemitter/package.json +2 -2
- package/node_modules/@protobufjs/eventemitter/tests/index.js +39 -3
- package/node_modules/@smithy/core/cbor.d.ts +1 -3
- package/node_modules/@smithy/core/cbor.js +0 -1
- package/node_modules/@smithy/core/checksum.d.ts +2 -2
- package/node_modules/@smithy/core/checksum.js +1 -1
- package/node_modules/@smithy/core/client.d.ts +1 -3
- package/node_modules/@smithy/core/client.js +0 -1
- package/node_modules/@smithy/core/config.d.ts +2 -2
- package/node_modules/@smithy/core/config.js +1 -1
- package/node_modules/@smithy/core/endpoints.d.ts +1 -3
- package/node_modules/@smithy/core/endpoints.js +0 -1
- package/node_modules/@smithy/core/event-streams.d.ts +1 -3
- package/node_modules/@smithy/core/event-streams.js +0 -1
- package/node_modules/@smithy/core/package.json +1 -1
- package/node_modules/@smithy/core/protocols.d.ts +1 -3
- package/node_modules/@smithy/core/protocols.js +0 -1
- package/node_modules/@smithy/core/retry.d.ts +2 -2
- package/node_modules/@smithy/core/retry.js +1 -1
- package/node_modules/@smithy/core/schema.d.ts +1 -3
- package/node_modules/@smithy/core/schema.js +0 -1
- package/node_modules/@smithy/core/serde.d.ts +1 -3
- package/node_modules/@smithy/core/serde.js +0 -1
- package/node_modules/@smithy/credential-provider-imds/package.json +2 -2
- package/node_modules/@smithy/fetch-http-handler/package.json +2 -2
- package/node_modules/@smithy/node-http-handler/package.json +2 -2
- package/node_modules/@smithy/signature-v4/package.json +2 -2
- package/node_modules/protobufjs/dist/light/protobuf.js +127 -69
- 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 +62 -25
- package/node_modules/protobufjs/dist/minimal/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/minimal/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/minimal/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/dist/protobuf.js +148 -76
- 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/ext/descriptor/index.js +7 -2
- package/node_modules/protobufjs/index.d.ts +12 -3
- package/node_modules/protobufjs/package.json +2 -2
- package/node_modules/protobufjs/src/converter.js +8 -5
- package/node_modules/protobufjs/src/encoder.js +8 -5
- package/node_modules/protobufjs/src/enum.js +2 -2
- package/node_modules/protobufjs/src/field.js +1 -1
- package/node_modules/protobufjs/src/namespace.js +2 -0
- package/node_modules/protobufjs/src/object.js +6 -6
- package/node_modules/protobufjs/src/parse.js +19 -5
- package/node_modules/protobufjs/src/root.js +14 -8
- package/node_modules/protobufjs/src/type.js +8 -5
- package/node_modules/protobufjs/src/util/minimal.js +32 -7
- package/node_modules/protobufjs/src/util/patterns.js +0 -1
- package/node_modules/protobufjs/src/util.js +4 -3
- package/node_modules/protobufjs/src/wrappers.js +11 -7
- package/node_modules/protobufjs/src/writer.js +11 -9
- package/node_modules/semver/classes/range.js +7 -0
- package/node_modules/semver/package.json +1 -1
- package/node_modules/semver/ranges/subset.js +2 -2
- package/package.json +2 -2
- package/slingshot/index.js +234 -234
|
@@ -223,9 +223,14 @@ var unnamedMessageIndex = 0;
|
|
|
223
223
|
* @param {IDescriptorProto|Reader|Uint8Array} descriptor Descriptor
|
|
224
224
|
* @param {string} [edition="proto2"] The syntax or edition to use
|
|
225
225
|
* @param {boolean} [nested=false] Whether or not this is a nested object
|
|
226
|
+
* @param {number} [depth] Current nesting depth, defaults to `0`
|
|
226
227
|
* @returns {Type} Type instance
|
|
227
228
|
*/
|
|
228
|
-
Type.fromDescriptor = function fromDescriptor(descriptor, edition, nested) {
|
|
229
|
+
Type.fromDescriptor = function fromDescriptor(descriptor, edition, nested, depth) {
|
|
230
|
+
if (depth === undefined)
|
|
231
|
+
depth = 0;
|
|
232
|
+
if (depth > $protobuf.util.nestingLimit)
|
|
233
|
+
throw Error("max depth exceeded");
|
|
229
234
|
// Decode the descriptor message if specified as a buffer:
|
|
230
235
|
if (typeof descriptor.length === "number")
|
|
231
236
|
descriptor = exports.DescriptorProto.decode(descriptor);
|
|
@@ -252,7 +257,7 @@ Type.fromDescriptor = function fromDescriptor(descriptor, edition, nested) {
|
|
|
252
257
|
type.add(Field.fromDescriptor(descriptor.extension[i], edition, true));
|
|
253
258
|
/* Nested types */ if (descriptor.nestedType)
|
|
254
259
|
for (i = 0; i < descriptor.nestedType.length; ++i) {
|
|
255
|
-
type.add(Type.fromDescriptor(descriptor.nestedType[i], edition, true));
|
|
260
|
+
type.add(Type.fromDescriptor(descriptor.nestedType[i], edition, true, depth + 1));
|
|
256
261
|
if (descriptor.nestedType[i].options && descriptor.nestedType[i].options.mapEntry)
|
|
257
262
|
type.setOption("map_entry", true);
|
|
258
263
|
}
|
|
@@ -2033,6 +2033,13 @@ export namespace util {
|
|
|
2033
2033
|
public length(): number;
|
|
2034
2034
|
}
|
|
2035
2035
|
|
|
2036
|
+
/**
|
|
2037
|
+
* Tests if the specified key can affect object prototypes.
|
|
2038
|
+
* @param key Key to test
|
|
2039
|
+
* @returns `true` if the key is unsafe
|
|
2040
|
+
*/
|
|
2041
|
+
function isUnsafeProperty(key: string): boolean;
|
|
2042
|
+
|
|
2036
2043
|
/** Whether running within node or not. */
|
|
2037
2044
|
let isNode: boolean;
|
|
2038
2045
|
|
|
@@ -2126,11 +2133,13 @@ export namespace util {
|
|
|
2126
2133
|
/**
|
|
2127
2134
|
* Merges the properties of the source object into the destination object.
|
|
2128
2135
|
* @param dst Destination object
|
|
2129
|
-
* @param src Source
|
|
2130
|
-
* @param [ifNotSet=false] Merges only if the key is not already set
|
|
2136
|
+
* @param src Source objects, optionally followed by an `ifNotSet` flag
|
|
2131
2137
|
* @returns Destination object
|
|
2132
2138
|
*/
|
|
2133
|
-
function merge(dst: { [k: string]: any }, src:
|
|
2139
|
+
function merge(dst: { [k: string]: any }, ...src: any[]): { [k: string]: any };
|
|
2140
|
+
|
|
2141
|
+
/** Schema declaration nesting limit. */
|
|
2142
|
+
let nestingLimit: number;
|
|
2134
2143
|
|
|
2135
2144
|
/** Recursion limit. */
|
|
2136
2145
|
let recursionLimit: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "protobufjs",
|
|
3
|
-
"version": "7.6.
|
|
3
|
+
"version": "7.6.1",
|
|
4
4
|
"versionScheme": "~",
|
|
5
5
|
"description": "Protocol Buffers for JavaScript (& TypeScript).",
|
|
6
6
|
"author": "Daniel Wirtz <dcode+protobufjs@dcode.io>",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"@protobufjs/aspromise": "^1.1.2",
|
|
61
61
|
"@protobufjs/base64": "^1.1.2",
|
|
62
62
|
"@protobufjs/codegen": "^2.0.5",
|
|
63
|
-
"@protobufjs/eventemitter": "^1.1.
|
|
63
|
+
"@protobufjs/eventemitter": "^1.1.1",
|
|
64
64
|
"@protobufjs/fetch": "^1.1.1",
|
|
65
65
|
"@protobufjs/float": "^1.0.2",
|
|
66
66
|
"@protobufjs/inquire": "^1.1.2",
|
|
@@ -61,14 +61,14 @@ function genValuePartial_fromObject(gen, field, fieldIndex, prop) {
|
|
|
61
61
|
("m%s=d%s|0", prop, prop);
|
|
62
62
|
break;
|
|
63
63
|
case "uint64":
|
|
64
|
+
case "fixed64":
|
|
64
65
|
isUnsigned = true;
|
|
65
66
|
// eslint-disable-next-line no-fallthrough
|
|
66
67
|
case "int64":
|
|
67
68
|
case "sint64":
|
|
68
|
-
case "fixed64":
|
|
69
69
|
case "sfixed64": gen
|
|
70
70
|
("if(util.Long)")
|
|
71
|
-
("
|
|
71
|
+
("m%s=util.Long.fromValue(d%s,%j)", prop, prop, isUnsigned)
|
|
72
72
|
("else if(typeof d%s===\"string\")", prop)
|
|
73
73
|
("m%s=parseInt(d%s,10)", prop, prop)
|
|
74
74
|
("else if(typeof d%s===\"number\")", prop)
|
|
@@ -172,7 +172,7 @@ function genValuePartial_toObject(gen, field, fieldIndex, prop) {
|
|
|
172
172
|
if (field.resolvedType instanceof Enum) gen
|
|
173
173
|
("d%s=o.enums===String?(types[%i].values[m%s]===undefined?m%s:types[%i].values[m%s]):m%s", prop, fieldIndex, prop, prop, fieldIndex, prop, prop);
|
|
174
174
|
else gen
|
|
175
|
-
("d%s=types[%i].toObject(m%s,o)", prop, fieldIndex, prop);
|
|
175
|
+
("d%s=types[%i].toObject(m%s,o,q+1)", prop, fieldIndex, prop);
|
|
176
176
|
} else {
|
|
177
177
|
var isUnsigned = false;
|
|
178
178
|
switch (field.type) {
|
|
@@ -181,11 +181,11 @@ function genValuePartial_toObject(gen, field, fieldIndex, prop) {
|
|
|
181
181
|
("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s", prop, prop, prop, prop);
|
|
182
182
|
break;
|
|
183
183
|
case "uint64":
|
|
184
|
+
case "fixed64":
|
|
184
185
|
isUnsigned = true;
|
|
185
186
|
// eslint-disable-next-line no-fallthrough
|
|
186
187
|
case "int64":
|
|
187
188
|
case "sint64":
|
|
188
|
-
case "fixed64":
|
|
189
189
|
case "sfixed64": gen
|
|
190
190
|
("if(typeof BigInt!==\"undefined\"&&o.longs===BigInt)")
|
|
191
191
|
("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)
|
|
@@ -216,9 +216,12 @@ converter.toObject = function toObject(mtype) {
|
|
|
216
216
|
var fields = mtype.fieldsArray.slice().sort(util.compareFieldsById);
|
|
217
217
|
if (!fields.length)
|
|
218
218
|
return util.codegen()("return {}");
|
|
219
|
-
var gen = util.codegen(["m", "o"], mtype.name + "$toObject")
|
|
219
|
+
var gen = util.codegen(["m", "o", "q"], mtype.name + "$toObject")
|
|
220
220
|
("if(!o)")
|
|
221
221
|
("o={}")
|
|
222
|
+
("if(q===undefined)q=0")
|
|
223
|
+
("if(q>util.recursionLimit)")
|
|
224
|
+
("throw Error(\"max depth exceeded\")")
|
|
222
225
|
("var d={}");
|
|
223
226
|
|
|
224
227
|
var repeatedFields = [],
|
|
@@ -16,8 +16,8 @@ var Enum = require("./enum"),
|
|
|
16
16
|
*/
|
|
17
17
|
function genTypePartial(gen, field, fieldIndex, ref) {
|
|
18
18
|
return field.delimited
|
|
19
|
-
? gen("types[%i].encode(%s,w.uint32(%i)).uint32(%i)", fieldIndex, ref, (field.id << 3 | 3) >>> 0, (field.id << 3 | 4) >>> 0)
|
|
20
|
-
: gen("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()", fieldIndex, ref, (field.id << 3 | 2) >>> 0);
|
|
19
|
+
? gen("types[%i].encode(%s,w.uint32(%i),q+1).uint32(%i)", fieldIndex, ref, (field.id << 3 | 3) >>> 0, (field.id << 3 | 4) >>> 0)
|
|
20
|
+
: gen("types[%i].encode(%s,w.uint32(%i).fork(),q+1).ldelim()", fieldIndex, ref, (field.id << 3 | 2) >>> 0);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
/**
|
|
@@ -27,9 +27,12 @@ function genTypePartial(gen, field, fieldIndex, ref) {
|
|
|
27
27
|
*/
|
|
28
28
|
function encoder(mtype) {
|
|
29
29
|
/* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */
|
|
30
|
-
var gen = util.codegen(["m", "w"], mtype.name + "$encode")
|
|
30
|
+
var gen = util.codegen(["m", "w", "q"], mtype.name + "$encode")
|
|
31
31
|
("if(!w)")
|
|
32
|
-
("w=Writer.create()")
|
|
32
|
+
("w=Writer.create()")
|
|
33
|
+
("if(q===undefined)q=0")
|
|
34
|
+
("if(q>util.recursionLimit)")
|
|
35
|
+
("throw Error(\"max depth exceeded\")");
|
|
33
36
|
|
|
34
37
|
var i, ref;
|
|
35
38
|
|
|
@@ -50,7 +53,7 @@ function encoder(mtype) {
|
|
|
50
53
|
("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){", ref)
|
|
51
54
|
("w.uint32(%i).fork().uint32(%i).%s(ks[i])", (field.id << 3 | 2) >>> 0, 8 | types.mapKey[field.keyType], field.keyType);
|
|
52
55
|
if (wireType === undefined) gen
|
|
53
|
-
("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()", index, ref); // can't be groups
|
|
56
|
+
("types[%i].encode(%s[ks[i]],w.uint32(18).fork(),q+1).ldelim().ldelim()", index, ref); // can't be groups
|
|
54
57
|
else gen
|
|
55
58
|
(".uint32(%i).%s(%s[ks[i]]).ldelim()", 16 | wireType, type, ref);
|
|
56
59
|
gen
|
|
@@ -86,8 +86,8 @@ Enum.prototype._resolveFeatures = function _resolveFeatures(edition) {
|
|
|
86
86
|
ReflectionObject.prototype._resolveFeatures.call(this, edition);
|
|
87
87
|
|
|
88
88
|
Object.keys(this.values).forEach(key => {
|
|
89
|
-
var parentFeaturesCopy =
|
|
90
|
-
this._valuesFeatures[key] =
|
|
89
|
+
var parentFeaturesCopy = util.merge({}, this._features);
|
|
90
|
+
this._valuesFeatures[key] = util.merge(parentFeaturesCopy, this.valuesOptions && this.valuesOptions[key] && this.valuesOptions[key].features || {});
|
|
91
91
|
});
|
|
92
92
|
|
|
93
93
|
return this;
|
|
@@ -328,7 +328,7 @@ Field.prototype.resolve = function resolve() {
|
|
|
328
328
|
|
|
329
329
|
// convert to internal data type if necesssary
|
|
330
330
|
if (this.long) {
|
|
331
|
-
this.typeDefault = util.Long.fromNumber(this.typeDefault, this.type.
|
|
331
|
+
this.typeDefault = util.Long.fromNumber(this.typeDefault, this.type === "uint64" || this.type === "fixed64");
|
|
332
332
|
|
|
333
333
|
/* istanbul ignore else */
|
|
334
334
|
if (Object.freeze)
|
|
@@ -337,6 +337,8 @@ Namespace.prototype.define = function define(path, json) {
|
|
|
337
337
|
throw TypeError("illegal path");
|
|
338
338
|
if (path && path.length && path[0] === "")
|
|
339
339
|
throw Error("path must be relative");
|
|
340
|
+
if (path.length > util.recursionLimit)
|
|
341
|
+
throw Error("max depth exceeded");
|
|
340
342
|
|
|
341
343
|
var ptr = this;
|
|
342
344
|
while (path.length > 0) {
|
|
@@ -213,7 +213,7 @@ ReflectionObject.prototype._resolveFeatures = function _resolveFeatures(edition)
|
|
|
213
213
|
throw new Error("Unknown edition for " + this.fullName);
|
|
214
214
|
}
|
|
215
215
|
|
|
216
|
-
var protoFeatures =
|
|
216
|
+
var protoFeatures = util.merge({}, this.options && this.options.features,
|
|
217
217
|
this._inferLegacyProtoFeatures(edition));
|
|
218
218
|
|
|
219
219
|
if (this._edition) {
|
|
@@ -228,7 +228,7 @@ ReflectionObject.prototype._resolveFeatures = function _resolveFeatures(edition)
|
|
|
228
228
|
} else {
|
|
229
229
|
throw new Error("Unknown edition: " + edition);
|
|
230
230
|
}
|
|
231
|
-
this._features =
|
|
231
|
+
this._features = util.merge(defaults, protoFeatures);
|
|
232
232
|
this._featuresResolved = true;
|
|
233
233
|
return;
|
|
234
234
|
}
|
|
@@ -237,13 +237,13 @@ ReflectionObject.prototype._resolveFeatures = function _resolveFeatures(edition)
|
|
|
237
237
|
// special-case it
|
|
238
238
|
/* istanbul ignore else */
|
|
239
239
|
if (this.partOf instanceof OneOf) {
|
|
240
|
-
var lexicalParentFeaturesCopy =
|
|
241
|
-
this._features =
|
|
240
|
+
var lexicalParentFeaturesCopy = util.merge({}, this.partOf._features);
|
|
241
|
+
this._features = util.merge(lexicalParentFeaturesCopy, protoFeatures);
|
|
242
242
|
} else if (this.declaringField) {
|
|
243
243
|
// Skip feature resolution of sister fields.
|
|
244
244
|
} else if (this.parent) {
|
|
245
|
-
var parentFeaturesCopy =
|
|
246
|
-
this._features =
|
|
245
|
+
var parentFeaturesCopy = util.merge({}, this.parent._features);
|
|
246
|
+
this._features = util.merge(parentFeaturesCopy, protoFeatures);
|
|
247
247
|
} else {
|
|
248
248
|
throw new Error("Unable to find a parent for " + this.fullName);
|
|
249
249
|
}
|
|
@@ -302,7 +302,9 @@ function parse(source, root, options) {
|
|
|
302
302
|
|
|
303
303
|
|
|
304
304
|
function parseCommon(parent, token, depth) {
|
|
305
|
-
depth
|
|
305
|
+
if (depth === undefined)
|
|
306
|
+
depth = 0;
|
|
307
|
+
// depth is checked by dispatched functions
|
|
306
308
|
switch (token) {
|
|
307
309
|
|
|
308
310
|
case "option":
|
|
@@ -352,7 +354,10 @@ function parse(source, root, options) {
|
|
|
352
354
|
}
|
|
353
355
|
|
|
354
356
|
function parseType(parent, token, depth) {
|
|
355
|
-
depth
|
|
357
|
+
if (depth === undefined)
|
|
358
|
+
depth = 0;
|
|
359
|
+
if (depth > util.nestingLimit)
|
|
360
|
+
throw Error("max depth exceeded");
|
|
356
361
|
|
|
357
362
|
/* istanbul ignore if */
|
|
358
363
|
if (!nameRe.test(token = next()))
|
|
@@ -478,7 +483,10 @@ function parse(source, root, options) {
|
|
|
478
483
|
}
|
|
479
484
|
|
|
480
485
|
function parseGroup(parent, rule, depth) {
|
|
481
|
-
depth
|
|
486
|
+
if (depth === undefined)
|
|
487
|
+
depth = 0;
|
|
488
|
+
if (depth > util.nestingLimit)
|
|
489
|
+
throw Error("max depth exceeded");
|
|
482
490
|
if (edition >= 2023) {
|
|
483
491
|
throw illegal("group");
|
|
484
492
|
}
|
|
@@ -697,7 +705,10 @@ function parse(source, root, options) {
|
|
|
697
705
|
}
|
|
698
706
|
|
|
699
707
|
function parseOptionValue(parent, name, depth) {
|
|
700
|
-
depth
|
|
708
|
+
if (depth === undefined)
|
|
709
|
+
depth = 0;
|
|
710
|
+
if (depth > util.recursionLimit)
|
|
711
|
+
throw Error("max depth exceeded");
|
|
701
712
|
// { a: "foo" b { c: "bar" } }
|
|
702
713
|
if (skip("{", true)) {
|
|
703
714
|
var objectResult = {};
|
|
@@ -786,7 +797,10 @@ function parse(source, root, options) {
|
|
|
786
797
|
}
|
|
787
798
|
|
|
788
799
|
function parseService(parent, token, depth) {
|
|
789
|
-
depth
|
|
800
|
+
if (depth === undefined)
|
|
801
|
+
depth = 0;
|
|
802
|
+
if (depth > util.recursionLimit)
|
|
803
|
+
throw Error("max depth exceeded");
|
|
790
804
|
|
|
791
805
|
/* istanbul ignore if */
|
|
792
806
|
if (!nameRe.test(token = next()))
|
|
@@ -138,8 +138,12 @@ Root.prototype.load = function load(filename, options, callback) {
|
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
// Processes a single file
|
|
141
|
-
function process(filename, source) {
|
|
141
|
+
function process(filename, source, depth) {
|
|
142
|
+
if (depth === undefined)
|
|
143
|
+
depth = 0;
|
|
142
144
|
try {
|
|
145
|
+
if (depth > util.recursionLimit)
|
|
146
|
+
throw Error("max depth exceeded");
|
|
143
147
|
if (util.isString(source) && source.charAt(0) === "{")
|
|
144
148
|
source = JSON.parse(source);
|
|
145
149
|
if (!util.isString(source))
|
|
@@ -152,11 +156,11 @@ Root.prototype.load = function load(filename, options, callback) {
|
|
|
152
156
|
if (parsed.imports)
|
|
153
157
|
for (; i < parsed.imports.length; ++i)
|
|
154
158
|
if (resolved = getBundledFileName(parsed.imports[i]) || self.resolvePath(filename, parsed.imports[i]))
|
|
155
|
-
fetch(resolved);
|
|
159
|
+
fetch(resolved, false, depth + 1);
|
|
156
160
|
if (parsed.weakImports)
|
|
157
161
|
for (i = 0; i < parsed.weakImports.length; ++i)
|
|
158
162
|
if (resolved = getBundledFileName(parsed.weakImports[i]) || self.resolvePath(filename, parsed.weakImports[i]))
|
|
159
|
-
fetch(resolved, true);
|
|
163
|
+
fetch(resolved, true, depth + 1);
|
|
160
164
|
}
|
|
161
165
|
} catch (err) {
|
|
162
166
|
finish(err);
|
|
@@ -167,7 +171,9 @@ Root.prototype.load = function load(filename, options, callback) {
|
|
|
167
171
|
}
|
|
168
172
|
|
|
169
173
|
// Fetches a single file
|
|
170
|
-
function fetch(filename, weak) {
|
|
174
|
+
function fetch(filename, weak, depth) {
|
|
175
|
+
if (depth === undefined)
|
|
176
|
+
depth = 0;
|
|
171
177
|
filename = getBundledFileName(filename) || filename;
|
|
172
178
|
|
|
173
179
|
// Skip if already loaded / attempted
|
|
@@ -179,12 +185,12 @@ Root.prototype.load = function load(filename, options, callback) {
|
|
|
179
185
|
// Shortcut bundled definitions
|
|
180
186
|
if (filename in common) {
|
|
181
187
|
if (sync) {
|
|
182
|
-
process(filename, common[filename]);
|
|
188
|
+
process(filename, common[filename], depth);
|
|
183
189
|
} else {
|
|
184
190
|
++queued;
|
|
185
191
|
setTimeout(function() {
|
|
186
192
|
--queued;
|
|
187
|
-
process(filename, common[filename]);
|
|
193
|
+
process(filename, common[filename], depth);
|
|
188
194
|
});
|
|
189
195
|
}
|
|
190
196
|
return;
|
|
@@ -200,7 +206,7 @@ Root.prototype.load = function load(filename, options, callback) {
|
|
|
200
206
|
finish(err);
|
|
201
207
|
return;
|
|
202
208
|
}
|
|
203
|
-
process(filename, source);
|
|
209
|
+
process(filename, source, depth);
|
|
204
210
|
} else {
|
|
205
211
|
++queued;
|
|
206
212
|
self.fetch(filename, function(err, source) {
|
|
@@ -217,7 +223,7 @@ Root.prototype.load = function load(filename, options, callback) {
|
|
|
217
223
|
finish(null, self);
|
|
218
224
|
return;
|
|
219
225
|
}
|
|
220
|
-
process(filename, source);
|
|
226
|
+
process(filename, source, depth);
|
|
221
227
|
});
|
|
222
228
|
}
|
|
223
229
|
}
|
|
@@ -237,7 +237,10 @@ function clearCache(type) {
|
|
|
237
237
|
* @returns {Type} Created message type
|
|
238
238
|
*/
|
|
239
239
|
Type.fromJSON = function fromJSON(name, json, depth) {
|
|
240
|
-
depth
|
|
240
|
+
if (depth === undefined)
|
|
241
|
+
depth = 0;
|
|
242
|
+
if (depth > util.nestingLimit)
|
|
243
|
+
throw Error("max depth exceeded");
|
|
241
244
|
var type = new Type(name, json.options);
|
|
242
245
|
type.extensions = json.extensions;
|
|
243
246
|
type.reserved = json.reserved;
|
|
@@ -515,8 +518,8 @@ Type.prototype.setup = function setup() {
|
|
|
515
518
|
* @param {Writer} [writer] Writer to encode to
|
|
516
519
|
* @returns {Writer} writer
|
|
517
520
|
*/
|
|
518
|
-
Type.prototype.encode = function encode_setup(message, writer) {
|
|
519
|
-
return this.setup().encode(
|
|
521
|
+
Type.prototype.encode = function encode_setup(message, writer) { // eslint-disable-line no-unused-vars
|
|
522
|
+
return this.setup().encode.apply(this, arguments); // overrides this method
|
|
520
523
|
};
|
|
521
524
|
|
|
522
525
|
/**
|
|
@@ -601,8 +604,8 @@ Type.prototype.fromObject = function fromObject(object, depth) {
|
|
|
601
604
|
* @param {IConversionOptions} [options] Conversion options
|
|
602
605
|
* @returns {Object.<string,*>} Plain object
|
|
603
606
|
*/
|
|
604
|
-
Type.prototype.toObject = function toObject(message, options) {
|
|
605
|
-
return this.setup().toObject(
|
|
607
|
+
Type.prototype.toObject = function toObject(message, options) { // eslint-disable-line no-unused-vars
|
|
608
|
+
return this.setup().toObject.apply(this, arguments);
|
|
606
609
|
};
|
|
607
610
|
|
|
608
611
|
/**
|
|
@@ -25,6 +25,18 @@ util.pool = require("@protobufjs/pool");
|
|
|
25
25
|
// utility to work with the low and high bits of a 64 bit value
|
|
26
26
|
util.LongBits = require("./longbits");
|
|
27
27
|
|
|
28
|
+
/**
|
|
29
|
+
* Tests if the specified key can affect object prototypes.
|
|
30
|
+
* @memberof util
|
|
31
|
+
* @param {string} key Key to test
|
|
32
|
+
* @returns {boolean} `true` if the key is unsafe
|
|
33
|
+
*/
|
|
34
|
+
function isUnsafeProperty(key) {
|
|
35
|
+
return key === "__proto__" || key === "prototype" || key === "constructor";
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
util.isUnsafeProperty = isUnsafeProperty;
|
|
39
|
+
|
|
28
40
|
/**
|
|
29
41
|
* Whether running within node or not.
|
|
30
42
|
* @memberof util
|
|
@@ -238,26 +250,39 @@ util.longFromHash = function longFromHash(hash, unsigned) {
|
|
|
238
250
|
* Merges the properties of the source object into the destination object.
|
|
239
251
|
* @memberof util
|
|
240
252
|
* @param {Object.<string,*>} dst Destination object
|
|
241
|
-
* @param {Object.<string
|
|
242
|
-
* @param {boolean} [ifNotSet=false] Merges only if the key is not already set
|
|
253
|
+
* @param {...(Object.<string,*>|boolean)} src Source objects, optionally followed by an `ifNotSet` flag
|
|
243
254
|
* @returns {Object.<string,*>} Destination object
|
|
244
255
|
*/
|
|
245
|
-
function merge(dst
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
256
|
+
function merge(dst) { // used by converters
|
|
257
|
+
var ifNotSet = typeof arguments[arguments.length - 1] === "boolean",
|
|
258
|
+
limit = ifNotSet ? arguments.length - 1 : arguments.length;
|
|
259
|
+
ifNotSet = ifNotSet && arguments[arguments.length - 1];
|
|
260
|
+
for (var a = 1; a < limit; ++a) {
|
|
261
|
+
var src = arguments[a];
|
|
262
|
+
if (!src)
|
|
263
|
+
continue;
|
|
264
|
+
for (var keys = Object.keys(src), i = 0; i < keys.length; ++i)
|
|
265
|
+
if (!isUnsafeProperty(keys[i]) && (dst[keys[i]] === undefined || !ifNotSet))
|
|
249
266
|
dst[keys[i]] = src[keys[i]];
|
|
267
|
+
}
|
|
250
268
|
return dst;
|
|
251
269
|
}
|
|
252
270
|
|
|
253
271
|
util.merge = merge;
|
|
254
272
|
|
|
273
|
+
/**
|
|
274
|
+
* Schema declaration nesting limit.
|
|
275
|
+
* @memberof util
|
|
276
|
+
* @type {number}
|
|
277
|
+
*/
|
|
278
|
+
util.nestingLimit = 32; // protoc: MaxMessageDeclarationNestingDepth
|
|
279
|
+
|
|
255
280
|
/**
|
|
256
281
|
* Recursion limit.
|
|
257
282
|
* @memberof util
|
|
258
283
|
* @type {number}
|
|
259
284
|
*/
|
|
260
|
-
util.recursionLimit = 100;
|
|
285
|
+
util.recursionLimit = 100; // protoc: CodedInputStream::default_recursion_limit_
|
|
261
286
|
|
|
262
287
|
/**
|
|
263
288
|
* Makes a property safe for assignment as an own property.
|
|
@@ -5,4 +5,3 @@ var patterns = exports;
|
|
|
5
5
|
patterns.numberRe = /^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/;
|
|
6
6
|
patterns.typeRefRe = /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/;
|
|
7
7
|
patterns.reservedRe = /^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/;
|
|
8
|
-
patterns.unsafePropertyRe = /^(?:__proto__|prototype|constructor)$/;
|
|
@@ -16,8 +16,7 @@ util.fetch = require("@protobufjs/fetch");
|
|
|
16
16
|
util.path = require("@protobufjs/path");
|
|
17
17
|
util.patterns = require("./util/patterns");
|
|
18
18
|
|
|
19
|
-
var reservedRe = util.patterns.reservedRe
|
|
20
|
-
unsafePropertyRe = util.patterns.unsafePropertyRe;
|
|
19
|
+
var reservedRe = util.patterns.reservedRe;
|
|
21
20
|
|
|
22
21
|
/**
|
|
23
22
|
* Node's fs module if available.
|
|
@@ -192,7 +191,7 @@ util.decorateEnum = function decorateEnum(object) {
|
|
|
192
191
|
util.setProperty = function setProperty(dst, path, value, ifNotSet) {
|
|
193
192
|
function setProp(dst, path, value) {
|
|
194
193
|
var part = path.shift();
|
|
195
|
-
if (
|
|
194
|
+
if (util.isUnsafeProperty(part))
|
|
196
195
|
return dst;
|
|
197
196
|
if (path.length > 0) {
|
|
198
197
|
dst[part] = setProp(dst[part] || {}, path, value);
|
|
@@ -213,6 +212,8 @@ util.setProperty = function setProperty(dst, path, value, ifNotSet) {
|
|
|
213
212
|
throw TypeError("path must be specified");
|
|
214
213
|
|
|
215
214
|
path = path.split(".");
|
|
215
|
+
if (path.length > util.recursionLimit)
|
|
216
|
+
throw Error("max depth exceeded");
|
|
216
217
|
return setProp(dst, path, value);
|
|
217
218
|
};
|
|
218
219
|
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
*/
|
|
8
8
|
var wrappers = exports;
|
|
9
9
|
|
|
10
|
-
var Message = require("./message")
|
|
10
|
+
var Message = require("./message"),
|
|
11
|
+
util = require("./util/minimal");
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* From object converter part of an {@link IWrapper}.
|
|
@@ -54,10 +55,9 @@ wrappers[".google.protobuf.Any"] = {
|
|
|
54
55
|
if (type_url.indexOf("/") === -1) {
|
|
55
56
|
type_url = "/" + type_url;
|
|
56
57
|
}
|
|
57
|
-
var nextDepth = depth === undefined ? 1 : depth + 1;
|
|
58
58
|
return this.create({
|
|
59
59
|
type_url: type_url,
|
|
60
|
-
value: type.encode(type.fromObject(object,
|
|
60
|
+
value: type.encode(type.fromObject(object, depth === undefined ? 1 : depth + 1)).finish()
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
63
|
}
|
|
@@ -65,7 +65,11 @@ wrappers[".google.protobuf.Any"] = {
|
|
|
65
65
|
return this.fromObject(object, depth);
|
|
66
66
|
},
|
|
67
67
|
|
|
68
|
-
toObject: function(message, options) {
|
|
68
|
+
toObject: function(message, options, depth) {
|
|
69
|
+
if (depth === undefined)
|
|
70
|
+
depth = 0;
|
|
71
|
+
if (depth > util.recursionLimit)
|
|
72
|
+
throw Error("max depth exceeded");
|
|
69
73
|
|
|
70
74
|
// Default prefix
|
|
71
75
|
var googleApi = "type.googleapis.com/";
|
|
@@ -81,12 +85,12 @@ wrappers[".google.protobuf.Any"] = {
|
|
|
81
85
|
var type = this.lookup(name);
|
|
82
86
|
/* istanbul ignore else */
|
|
83
87
|
if (type)
|
|
84
|
-
message = type.decode(message.value);
|
|
88
|
+
message = type.decode(message.value, undefined, undefined, depth + 1);
|
|
85
89
|
}
|
|
86
90
|
|
|
87
91
|
// wrap value if unmapped
|
|
88
92
|
if (!(message instanceof this.ctor) && message instanceof Message) {
|
|
89
|
-
var object = message.$type.toObject(message, options);
|
|
93
|
+
var object = message.$type.toObject(message, options, depth + 1);
|
|
90
94
|
var messageName = message.$type.fullName[0] === "." ?
|
|
91
95
|
message.$type.fullName.slice(1) : message.$type.fullName;
|
|
92
96
|
// Default to type.googleapis.com prefix if no prefix is used
|
|
@@ -98,6 +102,6 @@ wrappers[".google.protobuf.Any"] = {
|
|
|
98
102
|
return object;
|
|
99
103
|
}
|
|
100
104
|
|
|
101
|
-
return this.toObject(message, options);
|
|
105
|
+
return this.toObject(message, options, depth);
|
|
102
106
|
}
|
|
103
107
|
};
|
|
@@ -225,7 +225,7 @@ Writer.prototype.uint32 = function write_uint32(value) {
|
|
|
225
225
|
* @returns {Writer} `this`
|
|
226
226
|
*/
|
|
227
227
|
Writer.prototype.int32 = function write_int32(value) {
|
|
228
|
-
return value < 0
|
|
228
|
+
return (value |= 0) < 0
|
|
229
229
|
? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec
|
|
230
230
|
: this.uint32(value);
|
|
231
231
|
};
|
|
@@ -240,16 +240,18 @@ Writer.prototype.sint32 = function write_sint32(value) {
|
|
|
240
240
|
};
|
|
241
241
|
|
|
242
242
|
function writeVarint64(val, buf, pos) {
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
243
|
+
var lo = val.lo,
|
|
244
|
+
hi = val.hi;
|
|
245
|
+
while (hi) {
|
|
246
|
+
buf[pos++] = lo & 127 | 128;
|
|
247
|
+
lo = (lo >>> 7 | hi << 25) >>> 0;
|
|
248
|
+
hi >>>= 7;
|
|
247
249
|
}
|
|
248
|
-
while (
|
|
249
|
-
buf[pos++] =
|
|
250
|
-
|
|
250
|
+
while (lo > 127) {
|
|
251
|
+
buf[pos++] = lo & 127 | 128;
|
|
252
|
+
lo = lo >>> 7;
|
|
251
253
|
}
|
|
252
|
-
buf[pos++] =
|
|
254
|
+
buf[pos++] = lo;
|
|
253
255
|
}
|
|
254
256
|
|
|
255
257
|
/**
|
|
@@ -98,6 +98,9 @@ class Range {
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
parseRange (range) {
|
|
101
|
+
// strip build metadata so it can't bleed into the version
|
|
102
|
+
range = range.replace(BUILDSTRIPRE, '')
|
|
103
|
+
|
|
101
104
|
// memoize range parsing for performance.
|
|
102
105
|
// this is a very hot path, and fully deterministic.
|
|
103
106
|
const memoOpts =
|
|
@@ -223,6 +226,7 @@ const debug = require('../internal/debug')
|
|
|
223
226
|
const SemVer = require('./semver')
|
|
224
227
|
const {
|
|
225
228
|
safeRe: re,
|
|
229
|
+
src,
|
|
226
230
|
t,
|
|
227
231
|
comparatorTrimReplace,
|
|
228
232
|
tildeTrimReplace,
|
|
@@ -230,6 +234,9 @@ const {
|
|
|
230
234
|
} = require('../internal/re')
|
|
231
235
|
const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require('../internal/constants')
|
|
232
236
|
|
|
237
|
+
// unbounded global build-metadata stripper used by parseRange
|
|
238
|
+
const BUILDSTRIPRE = new RegExp(src[t.BUILD], 'g')
|
|
239
|
+
|
|
233
240
|
const isNullSet = c => c.value === '<0.0.0-0'
|
|
234
241
|
const isAny = c => c.value === ''
|
|
235
242
|
|
|
@@ -174,7 +174,7 @@ const simpleSubset = (sub, dom, options) => {
|
|
|
174
174
|
if (higher === c && higher !== gt) {
|
|
175
175
|
return false
|
|
176
176
|
}
|
|
177
|
-
} else if (gt.operator === '>=' && !
|
|
177
|
+
} else if (gt.operator === '>=' && !c.test(gt.semver)) {
|
|
178
178
|
return false
|
|
179
179
|
}
|
|
180
180
|
}
|
|
@@ -192,7 +192,7 @@ const simpleSubset = (sub, dom, options) => {
|
|
|
192
192
|
if (lower === c && lower !== lt) {
|
|
193
193
|
return false
|
|
194
194
|
}
|
|
195
|
-
} else if (lt.operator === '<=' && !
|
|
195
|
+
} else if (lt.operator === '<=' && !c.test(lt.semver)) {
|
|
196
196
|
return false
|
|
197
197
|
}
|
|
198
198
|
}
|