@bufbuild/protobuf 1.8.0 → 1.9.0
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/cjs/binary-encoding.d.ts +2 -2
- package/dist/cjs/google/protobuf/descriptor_pb.js +1 -1
- package/dist/cjs/google/protobuf/struct_pb.js +1 -1
- package/dist/cjs/google/protobuf/type_pb.js +1 -1
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/message.d.ts +1 -0
- package/dist/cjs/message.js +1 -0
- package/dist/cjs/private/json-format.js +1 -1
- package/dist/cjs/private/names.js +3 -3
- package/dist/cjs/private/util-common.js +3 -0
- package/dist/esm/binary-encoding.d.ts +2 -2
- package/dist/esm/google/protobuf/descriptor_pb.js +1 -1
- package/dist/esm/google/protobuf/struct_pb.js +1 -1
- package/dist/esm/google/protobuf/type_pb.js +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/message.d.ts +1 -0
- package/dist/esm/message.js +1 -0
- package/dist/esm/private/json-format.js +1 -1
- package/dist/esm/private/names.js +3 -3
- package/dist/esm/private/util-common.js +3 -0
- package/package.json +3 -3
|
@@ -63,11 +63,11 @@ export interface IBinaryReader {
|
|
|
63
63
|
*/
|
|
64
64
|
skip(wireType: WireType): Uint8Array;
|
|
65
65
|
/**
|
|
66
|
-
* Read a `
|
|
66
|
+
* Read a `uint32` field, an unsigned 32 bit varint.
|
|
67
67
|
*/
|
|
68
68
|
uint32(): number;
|
|
69
69
|
/**
|
|
70
|
-
* Read a `
|
|
70
|
+
* Read a `int32` field, a signed 32 bit varint.
|
|
71
71
|
*/
|
|
72
72
|
int32(): number;
|
|
73
73
|
/**
|
|
@@ -21,7 +21,7 @@ exports.GeneratedCodeInfo_Annotation_Semantic = exports.GeneratedCodeInfo_Annota
|
|
|
21
21
|
// The messages in this file describe the definitions found in .proto files.
|
|
22
22
|
// A valid .proto file can be translated directly to a FileDescriptorProto
|
|
23
23
|
// without any other information (e.g. without reading its imports).
|
|
24
|
-
// @generated by protoc-gen-es v1.
|
|
24
|
+
// @generated by protoc-gen-es v1.9.0 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts"
|
|
25
25
|
// @generated from file google/protobuf/descriptor.proto (package google.protobuf, syntax proto2)
|
|
26
26
|
/* eslint-disable */
|
|
27
27
|
const proto2_js_1 = require("../../proto2.js");
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
// limitations under the License.
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.ListValue = exports.Value = exports.Struct = exports.NullValue = void 0;
|
|
17
|
-
// @generated by protoc-gen-es v1.
|
|
17
|
+
// @generated by protoc-gen-es v1.9.0 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts"
|
|
18
18
|
// @generated from file google/protobuf/struct.proto (package google.protobuf, syntax proto3)
|
|
19
19
|
/* eslint-disable */
|
|
20
20
|
const proto3_js_1 = require("../../proto3.js");
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
// limitations under the License.
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.Option = exports.EnumValue = exports.Enum = exports.Field_Cardinality = exports.Field_Kind = exports.Field = exports.Type = exports.Syntax = void 0;
|
|
17
|
-
// @generated by protoc-gen-es v1.
|
|
17
|
+
// @generated by protoc-gen-es v1.9.0 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts"
|
|
18
18
|
// @generated from file google/protobuf/type.proto (package google.protobuf, syntax proto3)
|
|
19
19
|
/* eslint-disable */
|
|
20
20
|
const proto3_js_1 = require("../../proto3.js");
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export { codegenInfo } from "./codegen-info.js";
|
|
|
8
8
|
export { Message } from "./message.js";
|
|
9
9
|
export type { AnyMessage, PartialMessage, PlainMessage } from "./message.js";
|
|
10
10
|
export { isMessage } from "./is-message.js";
|
|
11
|
-
export type { FieldInfo } from "./field.js";
|
|
11
|
+
export type { FieldInfo, OneofInfo } from "./field.js";
|
|
12
12
|
export type { FieldList } from "./field-list.js";
|
|
13
13
|
export { LongType, ScalarType } from "./scalar.js";
|
|
14
14
|
export type { ScalarValue } from "./scalar.js";
|
package/dist/cjs/message.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export interface AnyMessage extends Message<AnyMessage> {
|
|
|
19
19
|
export declare class Message<T extends Message<T> = AnyMessage> {
|
|
20
20
|
/**
|
|
21
21
|
* Compare with a message of the same type.
|
|
22
|
+
* Note that this function disregards extensions and unknown fields.
|
|
22
23
|
*/
|
|
23
24
|
equals(other: T | PlainMessage<T> | undefined | null): boolean;
|
|
24
25
|
/**
|
package/dist/cjs/message.js
CHANGED
|
@@ -24,6 +24,7 @@ exports.Message = void 0;
|
|
|
24
24
|
class Message {
|
|
25
25
|
/**
|
|
26
26
|
* Compare with a message of the same type.
|
|
27
|
+
* Note that this function disregards extensions and unknown fields.
|
|
27
28
|
*/
|
|
28
29
|
equals(other) {
|
|
29
30
|
return this.getType().runtime.util.equals(this.getType(), this, other);
|
|
@@ -404,7 +404,7 @@ function readScalar(type, json, longType, nullAsZeroValue) {
|
|
|
404
404
|
}
|
|
405
405
|
if (int32 === undefined)
|
|
406
406
|
break;
|
|
407
|
-
if (type == scalar_js_1.ScalarType.UINT32)
|
|
407
|
+
if (type == scalar_js_1.ScalarType.UINT32 || type == scalar_js_1.ScalarType.FIXED32)
|
|
408
408
|
(0, assert_js_1.assertUInt32)(int32);
|
|
409
409
|
else
|
|
410
410
|
(0, assert_js_1.assertInt32)(int32);
|
|
@@ -43,11 +43,11 @@ function localName(desc) {
|
|
|
43
43
|
return (0, exports.safeObjectProperty)((0, exports.safeIdentifier)(name));
|
|
44
44
|
}
|
|
45
45
|
case "enum_value": {
|
|
46
|
+
let name = desc.name;
|
|
46
47
|
const sharedPrefix = desc.parent.sharedPrefix;
|
|
47
|
-
if (sharedPrefix
|
|
48
|
-
|
|
48
|
+
if (sharedPrefix !== undefined) {
|
|
49
|
+
name = name.substring(sharedPrefix.length);
|
|
49
50
|
}
|
|
50
|
-
const name = desc.name.substring(sharedPrefix.length);
|
|
51
51
|
return (0, exports.safeObjectProperty)(name);
|
|
52
52
|
}
|
|
53
53
|
case "rpc": {
|
|
@@ -208,6 +208,9 @@ function makeUtilCommon() {
|
|
|
208
208
|
}
|
|
209
209
|
any[member.localName] = copy;
|
|
210
210
|
}
|
|
211
|
+
for (const uf of type.runtime.bin.listUnknownFields(message)) {
|
|
212
|
+
type.runtime.bin.onUnknownField(any, uf.no, uf.wireType, uf.data);
|
|
213
|
+
}
|
|
211
214
|
return target;
|
|
212
215
|
},
|
|
213
216
|
};
|
|
@@ -63,11 +63,11 @@ export interface IBinaryReader {
|
|
|
63
63
|
*/
|
|
64
64
|
skip(wireType: WireType): Uint8Array;
|
|
65
65
|
/**
|
|
66
|
-
* Read a `
|
|
66
|
+
* Read a `uint32` field, an unsigned 32 bit varint.
|
|
67
67
|
*/
|
|
68
68
|
uint32(): number;
|
|
69
69
|
/**
|
|
70
|
-
* Read a `
|
|
70
|
+
* Read a `int32` field, a signed 32 bit varint.
|
|
71
71
|
*/
|
|
72
72
|
int32(): number;
|
|
73
73
|
/**
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
// The messages in this file describe the definitions found in .proto files.
|
|
19
19
|
// A valid .proto file can be translated directly to a FileDescriptorProto
|
|
20
20
|
// without any other information (e.g. without reading its imports).
|
|
21
|
-
// @generated by protoc-gen-es v1.
|
|
21
|
+
// @generated by protoc-gen-es v1.9.0 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts"
|
|
22
22
|
// @generated from file google/protobuf/descriptor.proto (package google.protobuf, syntax proto2)
|
|
23
23
|
/* eslint-disable */
|
|
24
24
|
import { proto2 } from "../../proto2.js";
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
// See the License for the specific language governing permissions and
|
|
13
13
|
// limitations under the License.
|
|
14
|
-
// @generated by protoc-gen-es v1.
|
|
14
|
+
// @generated by protoc-gen-es v1.9.0 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts"
|
|
15
15
|
// @generated from file google/protobuf/struct.proto (package google.protobuf, syntax proto3)
|
|
16
16
|
/* eslint-disable */
|
|
17
17
|
import { proto3 } from "../../proto3.js";
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
// See the License for the specific language governing permissions and
|
|
13
13
|
// limitations under the License.
|
|
14
|
-
// @generated by protoc-gen-es v1.
|
|
14
|
+
// @generated by protoc-gen-es v1.9.0 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts"
|
|
15
15
|
// @generated from file google/protobuf/type.proto (package google.protobuf, syntax proto3)
|
|
16
16
|
/* eslint-disable */
|
|
17
17
|
import { proto3 } from "../../proto3.js";
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export { codegenInfo } from "./codegen-info.js";
|
|
|
8
8
|
export { Message } from "./message.js";
|
|
9
9
|
export type { AnyMessage, PartialMessage, PlainMessage } from "./message.js";
|
|
10
10
|
export { isMessage } from "./is-message.js";
|
|
11
|
-
export type { FieldInfo } from "./field.js";
|
|
11
|
+
export type { FieldInfo, OneofInfo } from "./field.js";
|
|
12
12
|
export type { FieldList } from "./field-list.js";
|
|
13
13
|
export { LongType, ScalarType } from "./scalar.js";
|
|
14
14
|
export type { ScalarValue } from "./scalar.js";
|
package/dist/esm/message.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export interface AnyMessage extends Message<AnyMessage> {
|
|
|
19
19
|
export declare class Message<T extends Message<T> = AnyMessage> {
|
|
20
20
|
/**
|
|
21
21
|
* Compare with a message of the same type.
|
|
22
|
+
* Note that this function disregards extensions and unknown fields.
|
|
22
23
|
*/
|
|
23
24
|
equals(other: T | PlainMessage<T> | undefined | null): boolean;
|
|
24
25
|
/**
|
package/dist/esm/message.js
CHANGED
|
@@ -401,7 +401,7 @@ function readScalar(type, json, longType, nullAsZeroValue) {
|
|
|
401
401
|
}
|
|
402
402
|
if (int32 === undefined)
|
|
403
403
|
break;
|
|
404
|
-
if (type == ScalarType.UINT32)
|
|
404
|
+
if (type == ScalarType.UINT32 || type == ScalarType.FIXED32)
|
|
405
405
|
assertUInt32(int32);
|
|
406
406
|
else
|
|
407
407
|
assertInt32(int32);
|
|
@@ -40,11 +40,11 @@ export function localName(desc) {
|
|
|
40
40
|
return safeObjectProperty(safeIdentifier(name));
|
|
41
41
|
}
|
|
42
42
|
case "enum_value": {
|
|
43
|
+
let name = desc.name;
|
|
43
44
|
const sharedPrefix = desc.parent.sharedPrefix;
|
|
44
|
-
if (sharedPrefix
|
|
45
|
-
|
|
45
|
+
if (sharedPrefix !== undefined) {
|
|
46
|
+
name = name.substring(sharedPrefix.length);
|
|
46
47
|
}
|
|
47
|
-
const name = desc.name.substring(sharedPrefix.length);
|
|
48
48
|
return safeObjectProperty(name);
|
|
49
49
|
}
|
|
50
50
|
case "rpc": {
|
|
@@ -206,6 +206,9 @@ export function makeUtilCommon() {
|
|
|
206
206
|
}
|
|
207
207
|
any[member.localName] = copy;
|
|
208
208
|
}
|
|
209
|
+
for (const uf of type.runtime.bin.listUnknownFields(message)) {
|
|
210
|
+
type.runtime.bin.onUnknownField(any, uf.no, uf.wireType, uf.data);
|
|
211
|
+
}
|
|
209
212
|
return target;
|
|
210
213
|
},
|
|
211
214
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bufbuild/protobuf",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"license": "(Apache-2.0 AND BSD-3-Clause)",
|
|
5
5
|
"description": "A complete implementation of Protocol Buffers in TypeScript, suitable for web browsers and Node.js.",
|
|
6
6
|
"repository": {
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"scripts": {
|
|
12
12
|
"clean": "rm -rf ./dist/*",
|
|
13
13
|
"build": "npm run build:cjs && npm run build:esm",
|
|
14
|
-
"build:cjs": "../../node_modules/typescript/bin/tsc --project tsconfig.json --module commonjs --outDir ./dist/cjs --declaration --declarationDir ./dist/cjs && echo >./dist/cjs/package.json '{\"type\":\"commonjs\"}'",
|
|
15
|
-
"build:esm": "../../node_modules/typescript/bin/tsc --project tsconfig.json --
|
|
14
|
+
"build:cjs": "../../node_modules/typescript/bin/tsc --project tsconfig.json --module commonjs --verbatimModuleSyntax false --moduleResolution node10 --outDir ./dist/cjs --declaration --declarationDir ./dist/cjs && echo >./dist/cjs/package.json '{\"type\":\"commonjs\"}'",
|
|
15
|
+
"build:esm": "../../node_modules/typescript/bin/tsc --project tsconfig.json --outDir ./dist/esm --declaration --declarationDir ./dist/esm",
|
|
16
16
|
"bootstrap:featureset-defaults": "upstream-inject-feature-defaults src/private/feature-set.ts",
|
|
17
17
|
"prebootstrap:wkt": "rm -rf .tmp && mkdir -p .tmp/google/protobuf && cp -rp src/google/protobuf/* .tmp/google/protobuf",
|
|
18
18
|
"bootstrap:wkt": "protoc --es_out=src --es_opt=bootstrap_wkt=true,ts_nocheck=false,target=ts --proto_path $(upstream-include wkt) $(upstream-files wkt) && license-header src/google/protobuf",
|