Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bufbuild/protobuf

Package Overview
Dependencies
Maintainers
12
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bufbuild/protobuf - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

8

dist/cjs/google/protobuf/any_pb.js

@@ -49,3 +49,3 @@ "use strict";

*
* Example 3: Pack and unpack a message in Python.
* Example 3: Pack and unpack a message in Python.
*

@@ -60,3 +60,3 @@ * foo = Foo(...)

*
* Example 4: Pack and unpack a message in Go
* Example 4: Pack and unpack a message in Go
*

@@ -81,3 +81,3 @@ * foo := &pb.Foo{...}

* JSON
*
* ====
* The JSON representation of an `Any` value uses the regular

@@ -269,3 +269,2 @@ * representation of the deserialized, embedded message, with an

}
exports.Any = Any;
Any.runtime = proto3_js_1.proto3;

@@ -277,1 +276,2 @@ Any.typeName = "google.protobuf.Any";

]);
exports.Any = Any;

@@ -108,3 +108,2 @@ "use strict";

}
exports.Api = Api;
Api.runtime = proto3_js_1.proto3;

@@ -121,2 +120,3 @@ Api.typeName = "google.protobuf.Api";

]);
exports.Api = Api;
/**

@@ -187,3 +187,2 @@ * Method represents a method of an API interface.

}
exports.Method = Method;
Method.runtime = proto3_js_1.proto3;

@@ -200,2 +199,3 @@ Method.typeName = "google.protobuf.Method";

]);
exports.Method = Method;
/**

@@ -249,3 +249,3 @@ * Declares an API Interface to be included in this interface. The including

* `Storage`. A documentation generator or annotation processor will
* see the effective `Storage.GetAcl` method after inheriting
* see the effective `Storage.GetAcl` method after inherting
* documentation and annotations as follows:

@@ -315,3 +315,2 @@ *

}
exports.Mixin = Mixin;
Mixin.runtime = proto3_js_1.proto3;

@@ -323,1 +322,2 @@ Mixin.typeName = "google.protobuf.Mixin";

]);
exports.Mixin = Mixin;

@@ -43,3 +43,2 @@ "use strict";

}
exports.Version = Version;
Version.runtime = proto2_js_1.proto2;

@@ -53,2 +52,3 @@ Version.typeName = "google.protobuf.compiler.Version";

]);
exports.Version = Version;
/**

@@ -104,3 +104,2 @@ * An encoded CodeGeneratorRequest is written to the plugin's stdin.

}
exports.CodeGeneratorRequest = CodeGeneratorRequest;
CodeGeneratorRequest.runtime = proto2_js_1.proto2;

@@ -114,2 +113,3 @@ CodeGeneratorRequest.typeName = "google.protobuf.compiler.CodeGeneratorRequest";

]);
exports.CodeGeneratorRequest = CodeGeneratorRequest;
/**

@@ -142,3 +142,2 @@ * The plugin writes an encoded CodeGeneratorResponse to stdout.

}
exports.CodeGeneratorResponse = CodeGeneratorResponse;
CodeGeneratorResponse.runtime = proto2_js_1.proto2;

@@ -151,2 +150,3 @@ CodeGeneratorResponse.typeName = "google.protobuf.compiler.CodeGeneratorResponse";

]);
exports.CodeGeneratorResponse = CodeGeneratorResponse;
/**

@@ -196,3 +196,2 @@ * Sync with code_generator.h.

}
exports.CodeGeneratorResponse_File = CodeGeneratorResponse_File;
CodeGeneratorResponse_File.runtime = proto2_js_1.proto2;

@@ -206,1 +205,2 @@ CodeGeneratorResponse_File.typeName = "google.protobuf.compiler.CodeGeneratorResponse.File";

]);
exports.CodeGeneratorResponse_File = CodeGeneratorResponse_File;

@@ -163,3 +163,2 @@ "use strict";

}
exports.Duration = Duration;
Duration.runtime = proto3_js_1.proto3;

@@ -171,1 +170,2 @@ Duration.typeName = "google.protobuf.Duration";

]);
exports.Duration = Duration;

@@ -49,5 +49,5 @@ "use strict";

}
exports.Empty = Empty;
Empty.runtime = proto3_js_1.proto3;
Empty.typeName = "google.protobuf.Empty";
Empty.fields = proto3_js_1.proto3.util.newFieldList(() => []);
exports.Empty = Empty;

@@ -271,3 +271,3 @@ "use strict";

if (p.match(/_[0-9]?_/g) || p.match(/[A-Z]/g)) {
throw new Error("cannot decode google.protobuf.FieldMask from JSON: lowerCamelCase of path name \"" + p + "\" is irreversible");
throw new Error("cannot encode google.protobuf.FieldMask to JSON: lowerCamelCase of path name \"" + p + "\" is irreversible");
}

@@ -307,3 +307,2 @@ return protoCamelCase(p);

}
exports.FieldMask = FieldMask;
FieldMask.runtime = proto3_js_1.proto3;

@@ -314,1 +313,2 @@ FieldMask.typeName = "google.protobuf.FieldMask";

]);
exports.FieldMask = FieldMask;

@@ -50,3 +50,2 @@ "use strict";

}
exports.SourceContext = SourceContext;
SourceContext.runtime = proto3_js_1.proto3;

@@ -57,1 +56,2 @@ SourceContext.typeName = "google.protobuf.SourceContext";

]);
exports.SourceContext = SourceContext;

@@ -17,3 +17,3 @@ "use strict";

exports.ListValue = exports.Value = exports.Struct = exports.NullValue = void 0;
// @generated by protoc-gen-es v1.2.0 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts"
// @generated by protoc-gen-es v1.2.1 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts"
// @generated from file google/protobuf/struct.proto (package google.protobuf, syntax proto3)

@@ -27,3 +27,3 @@ /* eslint-disable */

*
* The JSON representation for `NullValue` is JSON `null`.
* The JSON representation for `NullValue` is JSON `null`.
*

@@ -97,3 +97,2 @@ * @generated from enum google.protobuf.NullValue

}
exports.Struct = Struct;
Struct.runtime = proto3_js_1.proto3;

@@ -104,2 +103,3 @@ Struct.typeName = "google.protobuf.Struct";

]);
exports.Struct = Struct;
/**

@@ -185,3 +185,2 @@ * `Value` represents a dynamically typed value which can be either

}
exports.Value = Value;
Value.runtime = proto3_js_1.proto3;

@@ -197,2 +196,3 @@ Value.typeName = "google.protobuf.Value";

]);
exports.Value = Value;
/**

@@ -241,3 +241,2 @@ * `ListValue` is a wrapper around a repeated field of values.

}
exports.ListValue = ListValue;
ListValue.runtime = proto3_js_1.proto3;

@@ -248,1 +247,2 @@ ListValue.typeName = "google.protobuf.ListValue";

]);
exports.ListValue = ListValue;

@@ -108,3 +108,3 @@ "use strict";

* the Joda Time's [`ISODateTimeFormat.dateTime()`](
* http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
* http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()
* ) to obtain a formatter capable of generating timestamps in this format.

@@ -208,3 +208,2 @@ *

}
exports.Timestamp = Timestamp;
Timestamp.runtime = proto3_js_1.proto3;

@@ -216,1 +215,2 @@ Timestamp.typeName = "google.protobuf.Timestamp";

]);
exports.Timestamp = Timestamp;

@@ -17,3 +17,3 @@ "use strict";

exports.Option = exports.EnumValue = exports.Enum = exports.Field_Cardinality = exports.Field_Kind = exports.Field = exports.Type = exports.Syntax = void 0;
// @generated by protoc-gen-es v1.2.0 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts"
// @generated by protoc-gen-es v1.2.1 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts"
// @generated from file google/protobuf/type.proto (package google.protobuf, syntax proto3)

@@ -44,2 +44,8 @@ /* eslint-disable */

Syntax[Syntax["PROTO3"] = 1] = "PROTO3";
/**
* Syntax `editions`.
*
* @generated from enum value: SYNTAX_EDITIONS = 2;
*/
Syntax[Syntax["EDITIONS"] = 2] = "EDITIONS";
})(Syntax = exports.Syntax || (exports.Syntax = {}));

@@ -50,2 +56,3 @@ // Retrieve enum metadata with: proto3.getEnumType(Syntax)

{ no: 1, name: "SYNTAX_PROTO3" },
{ no: 2, name: "SYNTAX_EDITIONS" },
]);

@@ -90,2 +97,8 @@ /**

this.syntax = Syntax.PROTO2;
/**
* The source edition string, only valid when syntax is SYNTAX_EDITIONS.
*
* @generated from field: string edition = 7;
*/
this.edition = "";
proto3_js_1.proto3.util.initPartial(data, this);

@@ -106,3 +119,2 @@ }

}
exports.Type = Type;
Type.runtime = proto3_js_1.proto3;

@@ -117,3 +129,5 @@ Type.typeName = "google.protobuf.Type";

{ no: 6, name: "syntax", kind: "enum", T: proto3_js_1.proto3.getEnumType(Syntax) },
{ no: 7, name: "edition", kind: "scalar", T: 9 /* ScalarType.STRING */ },
]);
exports.Type = Type;
/**

@@ -204,3 +218,2 @@ * A single field of a message type.

}
exports.Field = Field;
Field.runtime = proto3_js_1.proto3;

@@ -220,2 +233,3 @@ Field.typeName = "google.protobuf.Field";

]);
exports.Field = Field;
/**

@@ -436,2 +450,8 @@ * Basic field types.

this.syntax = Syntax.PROTO2;
/**
* The source edition string, only valid when syntax is SYNTAX_EDITIONS.
*
* @generated from field: string edition = 6;
*/
this.edition = "";
proto3_js_1.proto3.util.initPartial(data, this);

@@ -452,3 +472,2 @@ }

}
exports.Enum = Enum;
Enum.runtime = proto3_js_1.proto3;

@@ -462,3 +481,5 @@ Enum.typeName = "google.protobuf.Enum";

{ no: 5, name: "syntax", kind: "enum", T: proto3_js_1.proto3.getEnumType(Syntax) },
{ no: 6, name: "edition", kind: "scalar", T: 9 /* ScalarType.STRING */ },
]);
exports.Enum = Enum;
/**

@@ -505,3 +526,2 @@ * Enum value definition.

}
exports.EnumValue = EnumValue;
EnumValue.runtime = proto3_js_1.proto3;

@@ -514,2 +534,3 @@ EnumValue.typeName = "google.protobuf.EnumValue";

]);
exports.EnumValue = EnumValue;
/**

@@ -548,3 +569,2 @@ * A protocol buffer option, which can be attached to a message, field,

}
exports.Option = Option;
Option.runtime = proto3_js_1.proto3;

@@ -556,1 +576,2 @@ Option.typeName = "google.protobuf.Option";

]);
exports.Option = Option;

@@ -68,3 +68,2 @@ "use strict";

}
exports.DoubleValue = DoubleValue;
DoubleValue.runtime = proto3_js_1.proto3;

@@ -83,2 +82,3 @@ DoubleValue.typeName = "google.protobuf.DoubleValue";

};
exports.DoubleValue = DoubleValue;
/**

@@ -131,3 +131,2 @@ * Wrapper message for `float`.

}
exports.FloatValue = FloatValue;
FloatValue.runtime = proto3_js_1.proto3;

@@ -146,2 +145,3 @@ FloatValue.typeName = "google.protobuf.FloatValue";

};
exports.FloatValue = FloatValue;
/**

@@ -194,3 +194,2 @@ * Wrapper message for `int64`.

}
exports.Int64Value = Int64Value;
Int64Value.runtime = proto3_js_1.proto3;

@@ -209,2 +208,3 @@ Int64Value.typeName = "google.protobuf.Int64Value";

};
exports.Int64Value = Int64Value;
/**

@@ -257,3 +257,2 @@ * Wrapper message for `uint64`.

}
exports.UInt64Value = UInt64Value;
UInt64Value.runtime = proto3_js_1.proto3;

@@ -272,2 +271,3 @@ UInt64Value.typeName = "google.protobuf.UInt64Value";

};
exports.UInt64Value = UInt64Value;
/**

@@ -320,3 +320,2 @@ * Wrapper message for `int32`.

}
exports.Int32Value = Int32Value;
Int32Value.runtime = proto3_js_1.proto3;

@@ -335,2 +334,3 @@ Int32Value.typeName = "google.protobuf.Int32Value";

};
exports.Int32Value = Int32Value;
/**

@@ -383,3 +383,2 @@ * Wrapper message for `uint32`.

}
exports.UInt32Value = UInt32Value;
UInt32Value.runtime = proto3_js_1.proto3;

@@ -398,2 +397,3 @@ UInt32Value.typeName = "google.protobuf.UInt32Value";

};
exports.UInt32Value = UInt32Value;
/**

@@ -446,3 +446,2 @@ * Wrapper message for `bool`.

}
exports.BoolValue = BoolValue;
BoolValue.runtime = proto3_js_1.proto3;

@@ -461,2 +460,3 @@ BoolValue.typeName = "google.protobuf.BoolValue";

};
exports.BoolValue = BoolValue;
/**

@@ -509,3 +509,2 @@ * Wrapper message for `string`.

}
exports.StringValue = StringValue;
StringValue.runtime = proto3_js_1.proto3;

@@ -524,2 +523,3 @@ StringValue.typeName = "google.protobuf.StringValue";

};
exports.StringValue = StringValue;
/**

@@ -572,3 +572,2 @@ * Wrapper message for `bytes`.

}
exports.BytesValue = BytesValue;
BytesValue.runtime = proto3_js_1.proto3;

@@ -587,1 +586,2 @@ BytesValue.typeName = "google.protobuf.BytesValue";

};
exports.BytesValue = BytesValue;

@@ -54,7 +54,4 @@ "use strict";

Object.defineProperty(exports, "BinaryReader", { enumerable: true, get: function () { return binary_encoding_js_1.BinaryReader; } });
var json_format_js_1 = require("./json-format.js");
var descriptor_set_js_1 = require("./descriptor-set.js");
var create_descriptor_set_js_1 = require("./create-descriptor-set.js");
Object.defineProperty(exports, "createDescriptorSet", { enumerable: true, get: function () { return create_descriptor_set_js_1.createDescriptorSet; } });
var type_registry_js_1 = require("./type-registry.js");
var create_registry_js_1 = require("./create-registry.js");

@@ -61,0 +58,0 @@ Object.defineProperty(exports, "createRegistry", { enumerable: true, get: function () { return create_registry_js_1.createRegistry; } });

@@ -115,10 +115,10 @@ "use strict";

// safe to assume presence of array, oneof cannot contain repeated values
target[localName].push(messageType.fromBinary(reader.bytes(), options));
target[localName].push(readMessageField(reader, new messageType(), options));
}
else {
if (target[localName] instanceof message_js_1.Message) {
target[localName].fromBinary(reader.bytes(), options);
readMessageField(reader, target[localName], options);
}
else {
target[localName] = messageType.fromBinary(reader.bytes(), options);
target[localName] = readMessageField(reader, new messageType(), options);
if (messageType.fieldWrapper &&

@@ -143,2 +143,9 @@ !field.oneof &&

exports.makeBinaryFormatCommon = makeBinaryFormatCommon;
// Read a message, avoiding MessageType.fromBinary() to re-use the
// BinaryReadOptions and the IBinaryReader.
function readMessageField(reader, message, options) {
const format = message.getType().runtime.bin;
format.readMessage(message, reader, reader.uint32(), options);
return message;
}
// Read a map field, expecting key field = 1, value field = 2

@@ -163,3 +170,3 @@ function readMapEntry(field, reader, options) {

case "message":
val = field.V.T.fromBinary(reader.bytes(), options);
val = readMessageField(reader, new field.V.T(), options);
break;

@@ -195,5 +202,36 @@ }

}
// Does not use scalarTypeInfo() for better performance.
function readScalar(reader, type) {
let [, method] = (0, scalars_js_1.scalarTypeInfo)(type);
return reader[method]();
switch (type) {
case field_js_1.ScalarType.STRING:
return reader.string();
case field_js_1.ScalarType.BOOL:
return reader.bool();
case field_js_1.ScalarType.DOUBLE:
return reader.double();
case field_js_1.ScalarType.FLOAT:
return reader.float();
case field_js_1.ScalarType.INT32:
return reader.int32();
case field_js_1.ScalarType.INT64:
return reader.int64();
case field_js_1.ScalarType.UINT64:
return reader.uint64();
case field_js_1.ScalarType.FIXED64:
return reader.fixed64();
case field_js_1.ScalarType.BYTES:
return reader.bytes();
case field_js_1.ScalarType.FIXED32:
return reader.fixed32();
case field_js_1.ScalarType.SFIXED32:
return reader.sfixed32();
case field_js_1.ScalarType.SFIXED64:
return reader.sfixed64();
case field_js_1.ScalarType.SINT64:
return reader.sint64();
case field_js_1.ScalarType.UINT32:
return reader.uint32();
case field_js_1.ScalarType.SINT32:
return reader.sint32();
}
}

@@ -200,0 +238,0 @@ function writeMapEntry(writer, options, field, key, value) {

@@ -93,11 +93,3 @@ "use strict";

/**
* Decodes a base64 string to a byte array.
*
* - ignores white-space, including line breaks and tabs
* - allows inner padding (can decode concatenated base64 strings)
* - does not require padding
* - understands base64url encoding:
* "-" instead of "+",
* "_" instead of "/",
* no padding
* Encode a byte array to a base64 string.
*/

@@ -128,3 +120,3 @@ enc(bytes) {

}
// padding required?
// add output padding
if (groupPos) {

@@ -131,0 +123,0 @@ base64 += encTable[p];

@@ -14,3 +14,3 @@ // Copyright 2021-2023 Buf Technologies, Inc.

// limitations under the License.
import { FieldDescriptorProto_Label, FieldDescriptorProto_Type, FileDescriptorSet, MethodOptions_IdempotencyLevel, } from "./google/protobuf/descriptor_pb.js";
import { FieldDescriptorProto_Label, FieldDescriptorProto_Type, FileDescriptorProto, FileDescriptorSet, MethodDescriptorProto, MethodOptions_IdempotencyLevel, ServiceDescriptorProto, SourceCodeInfo, } from "./google/protobuf/descriptor_pb.js";
import { assert } from "./private/assert.js";

@@ -17,0 +17,0 @@ import { ScalarType } from "./field.js";

@@ -46,3 +46,3 @@ // Copyright 2021-2023 Buf Technologies, Inc.

*
* Example 3: Pack and unpack a message in Python.
* Example 3: Pack and unpack a message in Python.
*

@@ -57,3 +57,3 @@ * foo = Foo(...)

*
* Example 4: Pack and unpack a message in Go
* Example 4: Pack and unpack a message in Go
*

@@ -78,3 +78,3 @@ * foo := &pb.Foo{...}

* JSON
*
* ====
* The JSON representation of an `Any` value uses the regular

@@ -109,3 +109,3 @@ * representation of the deserialized, embedded message, with an

*/
export class Any extends Message {
class Any extends Message {
constructor(data) {

@@ -273,1 +273,2 @@ super();

]);
export { Any };

@@ -31,3 +31,3 @@ // Copyright 2021-2023 Buf Technologies, Inc.

*/
export class Api extends Message {
class Api extends Message {
constructor(data) {

@@ -117,2 +117,3 @@ super();

]);
export { Api };
/**

@@ -123,3 +124,3 @@ * Method represents a method of an API interface.

*/
export class Method extends Message {
class Method extends Message {
constructor(data) {

@@ -195,2 +196,3 @@ super();

]);
export { Method };
/**

@@ -244,3 +246,3 @@ * Declares an API Interface to be included in this interface. The including

* `Storage`. A documentation generator or annotation processor will
* see the effective `Storage.GetAcl` method after inheriting
* see the effective `Storage.GetAcl` method after inherting
* documentation and annotations as follows:

@@ -279,3 +281,3 @@ *

*/
export class Mixin extends Message {
class Mixin extends Message {
constructor(data) {

@@ -317,1 +319,2 @@ super();

]);
export { Mixin };

@@ -22,3 +22,3 @@ // Copyright 2021-2023 Buf Technologies, Inc.

*/
export class Version extends Message {
class Version extends Message {
constructor(data) {

@@ -49,2 +49,3 @@ super();

]);
export { Version };
/**

@@ -55,3 +56,3 @@ * An encoded CodeGeneratorRequest is written to the plugin's stdin.

*/
export class CodeGeneratorRequest extends Message {
class CodeGeneratorRequest extends Message {
constructor(data) {

@@ -109,2 +110,3 @@ super();

]);
export { CodeGeneratorRequest };
/**

@@ -115,3 +117,3 @@ * The plugin writes an encoded CodeGeneratorResponse to stdout.

*/
export class CodeGeneratorResponse extends Message {
class CodeGeneratorResponse extends Message {
constructor(data) {

@@ -145,2 +147,3 @@ super();

]);
export { CodeGeneratorResponse };
/**

@@ -172,3 +175,3 @@ * Sync with code_generator.h.

*/
export class CodeGeneratorResponse_File extends Message {
class CodeGeneratorResponse_File extends Message {
constructor(data) {

@@ -199,1 +202,2 @@ super();

]);
export { CodeGeneratorResponse_File };

@@ -80,3 +80,3 @@ // Copyright 2021-2023 Buf Technologies, Inc.

*/
export class Duration extends Message {
class Duration extends Message {
constructor(data) {

@@ -167,1 +167,2 @@ super();

]);
export { Duration };

@@ -28,3 +28,3 @@ // Copyright 2021-2023 Buf Technologies, Inc.

*/
export class Empty extends Message {
class Empty extends Message {
constructor(data) {

@@ -50,1 +50,2 @@ super();

Empty.fields = proto3.util.newFieldList(() => []);
export { Empty };

@@ -219,3 +219,3 @@ // Copyright 2021-2023 Buf Technologies, Inc.

*/
export class FieldMask extends Message {
class FieldMask extends Message {
constructor(data) {

@@ -269,3 +269,3 @@ super();

if (p.match(/_[0-9]?_/g) || p.match(/[A-Z]/g)) {
throw new Error("cannot decode google.protobuf.FieldMask from JSON: lowerCamelCase of path name \"" + p + "\" is irreversible");
throw new Error("cannot encode google.protobuf.FieldMask to JSON: lowerCamelCase of path name \"" + p + "\" is irreversible");
}

@@ -310,1 +310,2 @@ return protoCamelCase(p);

]);
export { FieldMask };

@@ -22,3 +22,3 @@ // Copyright 2021-2023 Buf Technologies, Inc.

*/
export class SourceContext extends Message {
class SourceContext extends Message {
constructor(data) {

@@ -53,1 +53,2 @@ super();

]);
export { SourceContext };

@@ -14,3 +14,3 @@ // Copyright 2021-2023 Buf Technologies, Inc.

// limitations under the License.
// @generated by protoc-gen-es v1.2.0 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts"
// @generated by protoc-gen-es v1.2.1 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts"
// @generated from file google/protobuf/struct.proto (package google.protobuf, syntax proto3)

@@ -24,3 +24,3 @@ /* eslint-disable */

*
* The JSON representation for `NullValue` is JSON `null`.
* The JSON representation for `NullValue` is JSON `null`.
*

@@ -54,3 +54,3 @@ * @generated from enum google.protobuf.NullValue

*/
export class Struct extends Message {
class Struct extends Message {
constructor(data) {

@@ -100,2 +100,3 @@ super();

]);
export { Struct };
/**

@@ -111,3 +112,3 @@ * `Value` represents a dynamically typed value which can be either

*/
export class Value extends Message {
class Value extends Message {
constructor(data) {

@@ -192,2 +193,3 @@ super();

]);
export { Value };
/**

@@ -200,3 +202,3 @@ * `ListValue` is a wrapper around a repeated field of values.

*/
export class ListValue extends Message {
class ListValue extends Message {
constructor(data) {

@@ -242,1 +244,2 @@ super();

]);
export { ListValue };

@@ -105,3 +105,3 @@ // Copyright 2021-2023 Buf Technologies, Inc.

* the Joda Time's [`ISODateTimeFormat.dateTime()`](
* http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
* http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()
* ) to obtain a formatter capable of generating timestamps in this format.

@@ -112,3 +112,3 @@ *

*/
export class Timestamp extends Message {
class Timestamp extends Message {
constructor(data) {

@@ -212,1 +212,2 @@ super();

]);
export { Timestamp };

@@ -14,3 +14,3 @@ // Copyright 2021-2023 Buf Technologies, Inc.

// limitations under the License.
// @generated by protoc-gen-es v1.2.0 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts"
// @generated by protoc-gen-es v1.2.1 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts"
// @generated from file google/protobuf/type.proto (package google.protobuf, syntax proto3)

@@ -41,2 +41,8 @@ /* eslint-disable */

Syntax[Syntax["PROTO3"] = 1] = "PROTO3";
/**
* Syntax `editions`.
*
* @generated from enum value: SYNTAX_EDITIONS = 2;
*/
Syntax[Syntax["EDITIONS"] = 2] = "EDITIONS";
})(Syntax || (Syntax = {}));

@@ -47,2 +53,3 @@ // Retrieve enum metadata with: proto3.getEnumType(Syntax)

{ no: 1, name: "SYNTAX_PROTO3" },
{ no: 2, name: "SYNTAX_EDITIONS" },
]);

@@ -54,3 +61,3 @@ /**

*/
export class Type extends Message {
class Type extends Message {
constructor(data) {

@@ -88,2 +95,8 @@ super();

this.syntax = Syntax.PROTO2;
/**
* The source edition string, only valid when syntax is SYNTAX_EDITIONS.
*
* @generated from field: string edition = 7;
*/
this.edition = "";
proto3.util.initPartial(data, this);

@@ -113,3 +126,5 @@ }

{ no: 6, name: "syntax", kind: "enum", T: proto3.getEnumType(Syntax) },
{ no: 7, name: "edition", kind: "scalar", T: 9 /* ScalarType.STRING */ },
]);
export { Type };
/**

@@ -120,3 +135,3 @@ * A single field of a message type.

*/
export class Field extends Message {
class Field extends Message {
constructor(data) {

@@ -215,2 +230,3 @@ super();

]);
export { Field };
/**

@@ -404,3 +420,3 @@ * Basic field types.

*/
export class Enum extends Message {
class Enum extends Message {
constructor(data) {

@@ -432,2 +448,8 @@ super();

this.syntax = Syntax.PROTO2;
/**
* The source edition string, only valid when syntax is SYNTAX_EDITIONS.
*
* @generated from field: string edition = 6;
*/
this.edition = "";
proto3.util.initPartial(data, this);

@@ -456,3 +478,5 @@ }

{ no: 5, name: "syntax", kind: "enum", T: proto3.getEnumType(Syntax) },
{ no: 6, name: "edition", kind: "scalar", T: 9 /* ScalarType.STRING */ },
]);
export { Enum };
/**

@@ -463,3 +487,3 @@ * Enum value definition.

*/
export class EnumValue extends Message {
class EnumValue extends Message {
constructor(data) {

@@ -507,2 +531,3 @@ super();

]);
export { EnumValue };
/**

@@ -514,3 +539,3 @@ * A protocol buffer option, which can be attached to a message, field,

*/
export class Option extends Message {
class Option extends Message {
constructor(data) {

@@ -548,1 +573,2 @@ super();

]);
export { Option };

@@ -25,3 +25,3 @@ // Copyright 2021-2023 Buf Technologies, Inc.

*/
export class DoubleValue extends Message {
class DoubleValue extends Message {
constructor(data) {

@@ -79,2 +79,3 @@ super();

};
export { DoubleValue };
/**

@@ -87,3 +88,3 @@ * Wrapper message for `float`.

*/
export class FloatValue extends Message {
class FloatValue extends Message {
constructor(data) {

@@ -141,2 +142,3 @@ super();

};
export { FloatValue };
/**

@@ -149,3 +151,3 @@ * Wrapper message for `int64`.

*/
export class Int64Value extends Message {
class Int64Value extends Message {
constructor(data) {

@@ -203,2 +205,3 @@ super();

};
export { Int64Value };
/**

@@ -211,3 +214,3 @@ * Wrapper message for `uint64`.

*/
export class UInt64Value extends Message {
class UInt64Value extends Message {
constructor(data) {

@@ -265,2 +268,3 @@ super();

};
export { UInt64Value };
/**

@@ -273,3 +277,3 @@ * Wrapper message for `int32`.

*/
export class Int32Value extends Message {
class Int32Value extends Message {
constructor(data) {

@@ -327,2 +331,3 @@ super();

};
export { Int32Value };
/**

@@ -335,3 +340,3 @@ * Wrapper message for `uint32`.

*/
export class UInt32Value extends Message {
class UInt32Value extends Message {
constructor(data) {

@@ -389,2 +394,3 @@ super();

};
export { UInt32Value };
/**

@@ -397,3 +403,3 @@ * Wrapper message for `bool`.

*/
export class BoolValue extends Message {
class BoolValue extends Message {
constructor(data) {

@@ -451,2 +457,3 @@ super();

};
export { BoolValue };
/**

@@ -459,3 +466,3 @@ * Wrapper message for `string`.

*/
export class StringValue extends Message {
class StringValue extends Message {
constructor(data) {

@@ -513,2 +520,3 @@ super();

};
export { StringValue };
/**

@@ -521,3 +529,3 @@ * Wrapper message for `bytes`.

*/
export class BytesValue extends Message {
class BytesValue extends Message {
constructor(data) {

@@ -575,1 +583,2 @@ super();

};
export { BytesValue };

@@ -20,10 +20,7 @@ // Copyright 2021-2023 Buf Technologies, Inc.

export { codegenInfo } from "./codegen-info.js";
export { Message, } from "./message.js";
export { Message } from "./message.js";
export { ScalarType } from "./field.js";
export { MethodKind, MethodIdempotency } from "./service-type.js";
export { WireType, BinaryWriter, BinaryReader } from "./binary-encoding.js";
export {} from "./json-format.js";
export {} from "./descriptor-set.js";
export { createDescriptorSet } from "./create-descriptor-set.js";
export {} from "./type-registry.js";
export { createRegistry } from "./create-registry.js";

@@ -30,0 +27,0 @@ export { createRegistryFromDescriptors } from "./create-registry-from-desc.js";

@@ -14,3 +14,3 @@ // Copyright 2021-2023 Buf Technologies, Inc.

// limitations under the License.
import { BinaryReader, BinaryWriter, WireType, } from "../binary-encoding.js";
import { BinaryReader, BinaryWriter, WireType } from "../binary-encoding.js";
import { Message } from "../message.js";

@@ -113,10 +113,10 @@ import { ScalarType } from "../field.js";

// safe to assume presence of array, oneof cannot contain repeated values
target[localName].push(messageType.fromBinary(reader.bytes(), options));
target[localName].push(readMessageField(reader, new messageType(), options));
}
else {
if (target[localName] instanceof Message) {
target[localName].fromBinary(reader.bytes(), options);
readMessageField(reader, target[localName], options);
}
else {
target[localName] = messageType.fromBinary(reader.bytes(), options);
target[localName] = readMessageField(reader, new messageType(), options);
if (messageType.fieldWrapper &&

@@ -140,2 +140,9 @@ !field.oneof &&

}
// Read a message, avoiding MessageType.fromBinary() to re-use the
// BinaryReadOptions and the IBinaryReader.
function readMessageField(reader, message, options) {
const format = message.getType().runtime.bin;
format.readMessage(message, reader, reader.uint32(), options);
return message;
}
// Read a map field, expecting key field = 1, value field = 2

@@ -160,3 +167,3 @@ function readMapEntry(field, reader, options) {

case "message":
val = field.V.T.fromBinary(reader.bytes(), options);
val = readMessageField(reader, new field.V.T(), options);
break;

@@ -192,5 +199,36 @@ }

}
// Does not use scalarTypeInfo() for better performance.
function readScalar(reader, type) {
let [, method] = scalarTypeInfo(type);
return reader[method]();
switch (type) {
case ScalarType.STRING:
return reader.string();
case ScalarType.BOOL:
return reader.bool();
case ScalarType.DOUBLE:
return reader.double();
case ScalarType.FLOAT:
return reader.float();
case ScalarType.INT32:
return reader.int32();
case ScalarType.INT64:
return reader.int64();
case ScalarType.UINT64:
return reader.uint64();
case ScalarType.FIXED64:
return reader.fixed64();
case ScalarType.BYTES:
return reader.bytes();
case ScalarType.FIXED32:
return reader.fixed32();
case ScalarType.SFIXED32:
return reader.sfixed32();
case ScalarType.SFIXED64:
return reader.sfixed64();
case ScalarType.SINT64:
return reader.sint64();
case ScalarType.UINT32:
return reader.uint32();
case ScalarType.SINT32:
return reader.sint32();
}
}

@@ -197,0 +235,0 @@ export function writeMapEntry(writer, options, field, key, value) {

@@ -14,3 +14,3 @@ // Copyright 2021-2023 Buf Technologies, Inc.

// limitations under the License.
import { Message, } from "../message.js";
import { Message } from "../message.js";
/**

@@ -17,0 +17,0 @@ * Create a new message type using the given runtime.

@@ -15,3 +15,3 @@ // Copyright 2021-2023 Buf Technologies, Inc.

import { setEnumType } from "./enum.js";
import { Message, } from "../message.js";
import { Message } from "../message.js";
import { ScalarType } from "../field.js";

@@ -18,0 +18,0 @@ import { scalarEquals } from "./scalars.js";

@@ -90,11 +90,3 @@ // Copyright 2021-2023 Buf Technologies, Inc.

/**
* Decodes a base64 string to a byte array.
*
* - ignores white-space, including line breaks and tabs
* - allows inner padding (can decode concatenated base64 strings)
* - does not require padding
* - understands base64url encoding:
* "-" instead of "+",
* "_" instead of "/",
* no padding
* Encode a byte array to a base64 string.
*/

@@ -125,3 +117,3 @@ enc(bytes) {

}
// padding required?
// add output padding
if (groupPos) {

@@ -128,0 +120,0 @@ base64 += encTable[p];

@@ -39,3 +39,3 @@ import type { PartialMessage, PlainMessage } from "../../message.js";

*
* Example 3: Pack and unpack a message in Python.
* Example 3: Pack and unpack a message in Python.
*

@@ -50,3 +50,3 @@ * foo = Foo(...)

*
* Example 4: Pack and unpack a message in Go
* Example 4: Pack and unpack a message in Go
*

@@ -71,3 +71,3 @@ * foo := &pb.Foo{...}

* JSON
*
* ====
* The JSON representation of an `Any` value uses the regular

@@ -74,0 +74,0 @@ * representation of the deserialized, embedded message, with an

@@ -200,3 +200,3 @@ import type { PartialMessage, PlainMessage } from "../../message.js";

* `Storage`. A documentation generator or annotation processor will
* see the effective `Storage.GetAcl` method after inheriting
* see the effective `Storage.GetAcl` method after inherting
* documentation and annotations as follows:

@@ -203,0 +203,0 @@ *

@@ -11,3 +11,3 @@ import { proto3 } from "../../proto3.js";

*
* The JSON representation for `NullValue` is JSON `null`.
* The JSON representation for `NullValue` is JSON `null`.
*

@@ -14,0 +14,0 @@ * @generated from enum google.protobuf.NullValue

@@ -95,3 +95,3 @@ import type { PartialMessage, PlainMessage } from "../../message.js";

* the Joda Time's [`ISODateTimeFormat.dateTime()`](
* http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
* http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()
* ) to obtain a formatter capable of generating timestamps in this format.

@@ -98,0 +98,0 @@ *

@@ -26,3 +26,9 @@ import { proto3 } from "../../proto3.js";

*/
PROTO3 = 1
PROTO3 = 1,
/**
* Syntax `editions`.
*
* @generated from enum value: SYNTAX_EDITIONS = 2;
*/
EDITIONS = 2
}

@@ -71,2 +77,8 @@ /**

syntax: Syntax;
/**
* The source edition string, only valid when syntax is SYNTAX_EDITIONS.
*
* @generated from field: string edition = 7;
*/
edition: string;
constructor(data?: PartialMessage<Type>);

@@ -346,2 +358,8 @@ static readonly runtime: typeof proto3;

syntax: Syntax;
/**
* The source edition string, only valid when syntax is SYNTAX_EDITIONS.
*
* @generated from field: string edition = 6;
*/
edition: string;
constructor(data?: PartialMessage<Enum>);

@@ -348,0 +366,0 @@ static readonly runtime: typeof proto3;

@@ -7,3 +7,4 @@ export { proto3 } from "./proto3.js";

export { codegenInfo } from "./codegen-info.js";
export { Message, AnyMessage, PartialMessage, PlainMessage, } from "./message.js";
export { Message } from "./message.js";
export type { AnyMessage, PartialMessage, PlainMessage } from "./message.js";
export type { FieldInfo } from "./field.js";

@@ -19,6 +20,6 @@ export type { FieldList } from "./field-list.js";

export type { BinaryFormat, BinaryWriteOptions, BinaryReadOptions, } from "./binary-format.js";
export { JsonFormat, JsonObject, JsonValue, JsonReadOptions, JsonWriteOptions, JsonWriteStringOptions, } from "./json-format.js";
export { DescriptorSet, AnyDesc, DescFile, DescEnum, DescEnumValue, DescMessage, DescOneof, DescField, DescService, DescMethod, DescExtension, DescComments, } from "./descriptor-set.js";
export type { JsonFormat, JsonObject, JsonValue, JsonReadOptions, JsonWriteOptions, JsonWriteStringOptions, } from "./json-format.js";
export type { DescriptorSet, AnyDesc, DescFile, DescEnum, DescEnumValue, DescMessage, DescOneof, DescField, DescService, DescMethod, DescExtension, DescComments, } from "./descriptor-set.js";
export { createDescriptorSet } from "./create-descriptor-set.js";
export { IMessageTypeRegistry } from "./type-registry.js";
export type { IMessageTypeRegistry } from "./type-registry.js";
export { createRegistry } from "./create-registry.js";

@@ -25,0 +26,0 @@ export { createRegistryFromDescriptors } from "./create-registry-from-desc.js";

@@ -1,5 +0,6 @@

import { IBinaryWriter } from "../binary-encoding.js";
import type { IBinaryWriter } from "../binary-encoding.js";
import type { BinaryWriteOptions } from "../binary-format.js";
import type { BinaryFormat } from "../binary-format.js";
import { FieldInfo, ScalarType } from "../field.js";
import { ScalarType } from "../field.js";
import type { FieldInfo } from "../field.js";
import type { MessageType } from "../message-type.js";

@@ -6,0 +7,0 @@ export declare function makeBinaryFormatCommon(): Omit<BinaryFormat, "writeMessage">;

import type { JsonFormat, JsonValue, JsonWriteOptions } from "../json-format.js";
import { FieldInfo, ScalarType } from "../field.js";
import { ScalarType } from "../field.js";
import type { FieldInfo } from "../field.js";
import type { EnumType } from "../enum.js";

@@ -4,0 +5,0 @@ type JsonFormatWriteFieldFn = (field: FieldInfo, value: any, options: JsonWriteOptions) => JsonValue | undefined;

@@ -1,2 +0,3 @@

import { AnyMessage, Message } from "../message.js";
import { Message } from "../message.js";
import type { AnyMessage } from "../message.js";
import type { FieldListSource } from "./field-list.js";

@@ -3,0 +4,0 @@ import type { MessageType } from "../message-type.js";

import { ScalarType } from "../field.js";
import { IBinaryWriter, WireType } from "../binary-encoding.js";
import type { IBinaryWriter } from "../binary-encoding.js";
import { WireType } from "../binary-encoding.js";
/**

@@ -4,0 +5,0 @@ * Returns true if both scalar values are equal.

@@ -15,13 +15,5 @@ export declare const protoBase64: {

/**
* Decodes a base64 string to a byte array.
*
* - ignores white-space, including line breaks and tabs
* - allows inner padding (can decode concatenated base64 strings)
* - does not require padding
* - understands base64url encoding:
* "-" instead of "+",
* "_" instead of "/",
* no padding
* Encode a byte array to a base64 string.
*/
readonly enc: (bytes: Uint8Array) => string;
};
{
"name": "@bufbuild/protobuf",
"version": "1.2.0",
"version": "1.2.1",
"license": "(Apache-2.0 AND BSD-3-Clause)",

@@ -16,3 +16,3 @@ "description": "A complete implementation of Protocol Buffers in TypeScript, suitable for web browsers and Node.js.",

"build:cjs": "../../node_modules/typescript/bin/tsc --project tsconfig.json --module commonjs --outDir ./dist/cjs && echo >./dist/cjs/package.json '{\"type\":\"commonjs\"}'",
"build:esm+types": "../../node_modules/typescript/bin/tsc --project tsconfig.json --module ES2015 --outDir ./dist/esm --declaration --declarationDir ./dist/types"
"build:esm+types": "../../node_modules/typescript/bin/tsc --project tsconfig.json --module ES2015 --verbatimModuleSyntax --outDir ./dist/esm --declaration --declarationDir ./dist/types"
},

@@ -19,0 +19,0 @@ "main": "./dist/cjs/index.js",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc