@bufbuild/protobuf 0.0.2-alpha.2 → 0.0.2-alpha.3
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/google/protobuf/any_pb.js +13 -33
- package/dist/cjs/google/protobuf/api_pb.js +10 -30
- package/dist/cjs/google/protobuf/compiler/plugin_pb.js +10 -45
- package/dist/cjs/google/protobuf/descriptor_pb.js +13 -39
- package/dist/cjs/google/protobuf/duration_pb.js +10 -30
- package/dist/cjs/google/protobuf/empty_pb.js +10 -30
- package/dist/cjs/google/protobuf/field_mask_pb.js +10 -30
- package/dist/cjs/google/protobuf/source_context_pb.js +10 -30
- package/dist/cjs/google/protobuf/struct_pb.js +10 -30
- package/dist/cjs/google/protobuf/timestamp_pb.js +10 -30
- package/dist/cjs/google/protobuf/type_pb.js +10 -30
- package/dist/cjs/google/protobuf/wrappers_pb.js +10 -39
- package/dist/cjs/index.js +3 -1
- package/dist/cjs/private/json-format-common.js +3 -3
- package/dist/cjs/proto-base64.js +138 -0
- package/dist/esm/google/protobuf/any_pb.js +13 -33
- package/dist/esm/google/protobuf/api_pb.js +10 -30
- package/dist/esm/google/protobuf/compiler/plugin_pb.js +10 -45
- package/dist/esm/google/protobuf/descriptor_pb.js +13 -39
- package/dist/esm/google/protobuf/duration_pb.js +10 -30
- package/dist/esm/google/protobuf/empty_pb.js +10 -30
- package/dist/esm/google/protobuf/field_mask_pb.js +10 -30
- package/dist/esm/google/protobuf/source_context_pb.js +10 -30
- package/dist/esm/google/protobuf/struct_pb.js +10 -30
- package/dist/esm/google/protobuf/timestamp_pb.js +10 -30
- package/dist/esm/google/protobuf/type_pb.js +10 -30
- package/dist/esm/google/protobuf/wrappers_pb.js +10 -39
- package/dist/esm/index.js +1 -0
- package/dist/esm/private/json-format-common.js +3 -3
- package/dist/esm/proto-base64.js +135 -0
- package/dist/types/google/protobuf/any_pb.d.ts +3 -3
- package/dist/types/google/protobuf/descriptor_pb.d.ts +16 -3
- package/dist/types/index.d.ts +1 -0
- package/dist/types/message-type.d.ts +2 -1
- package/dist/types/message.d.ts +3 -3
- package/dist/types/private/util.d.ts +2 -2
- package/dist/types/proto-base64.d.ts +26 -0
- package/package.json +1 -1
- package/dist/cjs/private/base64.js +0 -132
- package/dist/esm/private/base64.js +0 -127
- package/dist/types/private/base64.d.ts +0 -18
|
@@ -1,37 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
// @generated by protoc-gen-es v0.0.2-alpha.2 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts"
|
|
4
|
-
// @generated from file google/protobuf/type.proto (package google.protobuf, syntax proto3)
|
|
2
|
+
// Copyright 2021-2022 Buf Technologies, Inc.
|
|
5
3
|
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
// you may not use this file except in compliance with the License.
|
|
6
|
+
// You may obtain a copy of the License at
|
|
9
7
|
//
|
|
10
|
-
//
|
|
11
|
-
// modification, are permitted provided that the following conditions are
|
|
12
|
-
// met:
|
|
8
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
13
9
|
//
|
|
14
|
-
//
|
|
15
|
-
//
|
|
16
|
-
//
|
|
17
|
-
//
|
|
18
|
-
//
|
|
19
|
-
// distribution.
|
|
20
|
-
// * Neither the name of Google Inc. nor the names of its
|
|
21
|
-
// contributors may be used to endorse or promote products derived from
|
|
22
|
-
// this software without specific prior written permission.
|
|
23
|
-
//
|
|
24
|
-
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
25
|
-
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
26
|
-
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
27
|
-
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
28
|
-
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
29
|
-
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
30
|
-
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
31
|
-
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
32
|
-
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
33
|
-
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
34
|
-
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
// See the License for the specific language governing permissions and
|
|
14
|
+
// limitations under the License.
|
|
35
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
16
|
exports.Option = exports.EnumValue = exports.Enum = exports.Field_Cardinality = exports.Field_Kind = exports.Field = exports.Type = exports.Syntax = void 0;
|
|
37
17
|
const index_js_1 = require("../../index.js");
|
|
@@ -1,46 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
// @generated by protoc-gen-es v0.0.2-alpha.2 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts"
|
|
4
|
-
// @generated from file google/protobuf/wrappers.proto (package google.protobuf, syntax proto3)
|
|
2
|
+
// Copyright 2021-2022 Buf Technologies, Inc.
|
|
5
3
|
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
// you may not use this file except in compliance with the License.
|
|
6
|
+
// You may obtain a copy of the License at
|
|
9
7
|
//
|
|
10
|
-
//
|
|
11
|
-
// modification, are permitted provided that the following conditions are
|
|
12
|
-
// met:
|
|
8
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
13
9
|
//
|
|
14
|
-
//
|
|
15
|
-
//
|
|
16
|
-
//
|
|
17
|
-
//
|
|
18
|
-
//
|
|
19
|
-
// distribution.
|
|
20
|
-
// * Neither the name of Google Inc. nor the names of its
|
|
21
|
-
// contributors may be used to endorse or promote products derived from
|
|
22
|
-
// this software without specific prior written permission.
|
|
23
|
-
//
|
|
24
|
-
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
25
|
-
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
26
|
-
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
27
|
-
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
28
|
-
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
29
|
-
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
30
|
-
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
31
|
-
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
32
|
-
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
33
|
-
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
34
|
-
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
35
|
-
// Wrappers for primitive (non-message) types. These types are useful
|
|
36
|
-
// for embedding primitives in the `google.protobuf.Any` type and for places
|
|
37
|
-
// where we need to distinguish between the absence of a primitive
|
|
38
|
-
// typed field and its default value.
|
|
39
|
-
//
|
|
40
|
-
// These wrappers have no meaningful use within repeated fields as they lack
|
|
41
|
-
// the ability to detect presence on individual elements.
|
|
42
|
-
// These wrappers have no meaningful use within a map or a oneof since
|
|
43
|
-
// individual entries of a map or fields of a oneof can already detect presence.
|
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
// See the License for the specific language governing permissions and
|
|
14
|
+
// limitations under the License.
|
|
44
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
16
|
exports.BytesValue = exports.StringValue = exports.BoolValue = exports.UInt32Value = exports.Int32Value = exports.UInt64Value = exports.Int64Value = exports.FloatValue = exports.DoubleValue = void 0;
|
|
46
17
|
const index_js_1 = require("../../index.js");
|
package/dist/cjs/index.js
CHANGED
|
@@ -27,13 +27,15 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
27
27
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
28
28
|
};
|
|
29
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
-
exports.BinaryReader = exports.BinaryWriter = exports.WireType = exports.DescriptorSet = exports.DescriptorRegistry = exports.TypeRegistry = exports.MethodIdempotency = exports.MethodKind = exports.ScalarType = exports.Message = exports.protoInt64 = exports.proto2 = exports.proto3 = void 0;
|
|
30
|
+
exports.BinaryReader = exports.BinaryWriter = exports.WireType = exports.DescriptorSet = exports.DescriptorRegistry = exports.TypeRegistry = exports.MethodIdempotency = exports.MethodKind = exports.ScalarType = exports.Message = exports.protoBase64 = exports.protoInt64 = exports.proto2 = exports.proto3 = void 0;
|
|
31
31
|
var proto3_js_1 = require("./proto3.js");
|
|
32
32
|
Object.defineProperty(exports, "proto3", { enumerable: true, get: function () { return proto3_js_1.proto3; } });
|
|
33
33
|
var proto2_js_1 = require("./proto2.js");
|
|
34
34
|
Object.defineProperty(exports, "proto2", { enumerable: true, get: function () { return proto2_js_1.proto2; } });
|
|
35
35
|
var proto_int64_js_1 = require("./proto-int64.js");
|
|
36
36
|
Object.defineProperty(exports, "protoInt64", { enumerable: true, get: function () { return proto_int64_js_1.protoInt64; } });
|
|
37
|
+
var proto_base64_js_1 = require("./proto-base64.js");
|
|
38
|
+
Object.defineProperty(exports, "protoBase64", { enumerable: true, get: function () { return proto_base64_js_1.protoBase64; } });
|
|
37
39
|
var message_js_1 = require("./message.js");
|
|
38
40
|
Object.defineProperty(exports, "Message", { enumerable: true, get: function () { return message_js_1.Message; } });
|
|
39
41
|
var field_js_1 = require("./field.js");
|
|
@@ -18,7 +18,7 @@ const field_wrapper_js_1 = require("./field-wrapper.js");
|
|
|
18
18
|
const field_js_1 = require("../field.js");
|
|
19
19
|
const assert_js_1 = require("./assert.js");
|
|
20
20
|
const proto_int64_js_1 = require("../proto-int64.js");
|
|
21
|
-
const
|
|
21
|
+
const proto_base64_js_1 = require("../proto-base64.js");
|
|
22
22
|
/* eslint-disable no-case-declarations, @typescript-eslint/restrict-plus-operands,@typescript-eslint/no-explicit-any,@typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-argument */
|
|
23
23
|
// Default options for parsing JSON.
|
|
24
24
|
const jsonReadDefaults = {
|
|
@@ -367,7 +367,7 @@ function readScalar(type, json) {
|
|
|
367
367
|
return new Uint8Array(0);
|
|
368
368
|
if (typeof json !== "string")
|
|
369
369
|
break;
|
|
370
|
-
return
|
|
370
|
+
return proto_base64_js_1.protoBase64.dec(json);
|
|
371
371
|
}
|
|
372
372
|
throw new Error();
|
|
373
373
|
}
|
|
@@ -463,7 +463,7 @@ function writeScalar(type, value, emitIntrinsicDefault) {
|
|
|
463
463
|
case field_js_1.ScalarType.BYTES:
|
|
464
464
|
(0, assert_js_1.assert)(value instanceof Uint8Array);
|
|
465
465
|
return emitIntrinsicDefault || value.byteLength > 0
|
|
466
|
-
?
|
|
466
|
+
? proto_base64_js_1.protoBase64.enc(value)
|
|
467
467
|
: undefined;
|
|
468
468
|
}
|
|
469
469
|
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2021-2022 Buf Technologies, Inc.
|
|
3
|
+
//
|
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
// you may not use this file except in compliance with the License.
|
|
6
|
+
// You may obtain a copy of the License at
|
|
7
|
+
//
|
|
8
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
//
|
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
// See the License for the specific language governing permissions and
|
|
14
|
+
// limitations under the License.
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.protoBase64 = void 0;
|
|
17
|
+
/* eslint-disable @typescript-eslint/ban-ts-comment, @typescript-eslint/no-unnecessary-condition, prefer-const */
|
|
18
|
+
// lookup table from base64 character to byte
|
|
19
|
+
let encTable = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");
|
|
20
|
+
// lookup table from base64 character *code* to byte because lookup by number is fast
|
|
21
|
+
let decTable = [];
|
|
22
|
+
for (let i = 0; i < encTable.length; i++)
|
|
23
|
+
decTable[encTable[i].charCodeAt(0)] = i;
|
|
24
|
+
// support base64url variants
|
|
25
|
+
decTable["-".charCodeAt(0)] = encTable.indexOf("+");
|
|
26
|
+
decTable["_".charCodeAt(0)] = encTable.indexOf("/");
|
|
27
|
+
exports.protoBase64 = {
|
|
28
|
+
/**
|
|
29
|
+
* Decodes a base64 string to a byte array.
|
|
30
|
+
*
|
|
31
|
+
* - ignores white-space, including line breaks and tabs
|
|
32
|
+
* - allows inner padding (can decode concatenated base64 strings)
|
|
33
|
+
* - does not require padding
|
|
34
|
+
* - understands base64url encoding:
|
|
35
|
+
* "-" instead of "+",
|
|
36
|
+
* "_" instead of "/",
|
|
37
|
+
* no padding
|
|
38
|
+
*/
|
|
39
|
+
dec(base64Str) {
|
|
40
|
+
// estimate byte size, not accounting for inner padding and whitespace
|
|
41
|
+
let es = (base64Str.length * 3) / 4;
|
|
42
|
+
// if (es % 3 !== 0)
|
|
43
|
+
// throw new Error("invalid base64 string");
|
|
44
|
+
if (base64Str[base64Str.length - 2] == "=")
|
|
45
|
+
es -= 2;
|
|
46
|
+
else if (base64Str[base64Str.length - 1] == "=")
|
|
47
|
+
es -= 1;
|
|
48
|
+
let bytes = new Uint8Array(es), bytePos = 0, // position in byte array
|
|
49
|
+
groupPos = 0, // position in base64 group
|
|
50
|
+
b, // current byte
|
|
51
|
+
p = 0; // previous byte
|
|
52
|
+
for (let i = 0; i < base64Str.length; i++) {
|
|
53
|
+
b = decTable[base64Str.charCodeAt(i)];
|
|
54
|
+
if (b === undefined) {
|
|
55
|
+
switch (base64Str[i]) {
|
|
56
|
+
// @ts-ignore TS7029: Fallthrough case in switch
|
|
57
|
+
case "=":
|
|
58
|
+
groupPos = 0; // reset state when padding found
|
|
59
|
+
// @ts-ignore TS7029: Fallthrough case in switch
|
|
60
|
+
case "\n":
|
|
61
|
+
case "\r":
|
|
62
|
+
case "\t":
|
|
63
|
+
case " ":
|
|
64
|
+
continue; // skip white-space, and padding
|
|
65
|
+
default:
|
|
66
|
+
throw Error("invalid base64 string.");
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
switch (groupPos) {
|
|
70
|
+
case 0:
|
|
71
|
+
p = b;
|
|
72
|
+
groupPos = 1;
|
|
73
|
+
break;
|
|
74
|
+
case 1:
|
|
75
|
+
bytes[bytePos++] = (p << 2) | ((b & 48) >> 4);
|
|
76
|
+
p = b;
|
|
77
|
+
groupPos = 2;
|
|
78
|
+
break;
|
|
79
|
+
case 2:
|
|
80
|
+
bytes[bytePos++] = ((p & 15) << 4) | ((b & 60) >> 2);
|
|
81
|
+
p = b;
|
|
82
|
+
groupPos = 3;
|
|
83
|
+
break;
|
|
84
|
+
case 3:
|
|
85
|
+
bytes[bytePos++] = ((p & 3) << 6) | b;
|
|
86
|
+
groupPos = 0;
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
if (groupPos == 1)
|
|
91
|
+
throw Error("invalid base64 string.");
|
|
92
|
+
return bytes.subarray(0, bytePos);
|
|
93
|
+
},
|
|
94
|
+
/**
|
|
95
|
+
* Decodes a base64 string to a byte array.
|
|
96
|
+
*
|
|
97
|
+
* - ignores white-space, including line breaks and tabs
|
|
98
|
+
* - allows inner padding (can decode concatenated base64 strings)
|
|
99
|
+
* - does not require padding
|
|
100
|
+
* - understands base64url encoding:
|
|
101
|
+
* "-" instead of "+",
|
|
102
|
+
* "_" instead of "/",
|
|
103
|
+
* no padding
|
|
104
|
+
*/
|
|
105
|
+
enc(bytes) {
|
|
106
|
+
let base64 = "", groupPos = 0, // position in base64 group
|
|
107
|
+
b, // current byte
|
|
108
|
+
p = 0; // carry over from previous byte
|
|
109
|
+
for (let i = 0; i < bytes.length; i++) {
|
|
110
|
+
b = bytes[i];
|
|
111
|
+
switch (groupPos) {
|
|
112
|
+
case 0:
|
|
113
|
+
base64 += encTable[b >> 2];
|
|
114
|
+
p = (b & 3) << 4;
|
|
115
|
+
groupPos = 1;
|
|
116
|
+
break;
|
|
117
|
+
case 1:
|
|
118
|
+
base64 += encTable[p | (b >> 4)];
|
|
119
|
+
p = (b & 15) << 2;
|
|
120
|
+
groupPos = 2;
|
|
121
|
+
break;
|
|
122
|
+
case 2:
|
|
123
|
+
base64 += encTable[p | (b >> 6)];
|
|
124
|
+
base64 += encTable[b & 63];
|
|
125
|
+
groupPos = 0;
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
// padding required?
|
|
130
|
+
if (groupPos) {
|
|
131
|
+
base64 += encTable[p];
|
|
132
|
+
base64 += "=";
|
|
133
|
+
if (groupPos == 1)
|
|
134
|
+
base64 += "=";
|
|
135
|
+
}
|
|
136
|
+
return base64;
|
|
137
|
+
},
|
|
138
|
+
};
|
|
@@ -1,36 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
// @generated by protoc-gen-es v0.0.2-alpha.2 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts"
|
|
3
|
-
// @generated from file google/protobuf/any.proto (package google.protobuf, syntax proto3)
|
|
1
|
+
// Copyright 2021-2022 Buf Technologies, Inc.
|
|
4
2
|
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
8
6
|
//
|
|
9
|
-
//
|
|
10
|
-
// modification, are permitted provided that the following conditions are
|
|
11
|
-
// met:
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
12
8
|
//
|
|
13
|
-
//
|
|
14
|
-
//
|
|
15
|
-
//
|
|
16
|
-
//
|
|
17
|
-
//
|
|
18
|
-
// distribution.
|
|
19
|
-
// * Neither the name of Google Inc. nor the names of its
|
|
20
|
-
// contributors may be used to endorse or promote products derived from
|
|
21
|
-
// this software without specific prior written permission.
|
|
22
|
-
//
|
|
23
|
-
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
24
|
-
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
25
|
-
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
26
|
-
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
27
|
-
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
28
|
-
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
29
|
-
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
30
|
-
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
31
|
-
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
32
|
-
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
33
|
-
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
34
14
|
import { Message, proto3 } from "../../index.js";
|
|
35
15
|
/**
|
|
36
16
|
* `Any` contains an arbitrary serialized protocol buffer message along with a
|
|
@@ -58,7 +38,7 @@ import { Message, proto3 } from "../../index.js";
|
|
|
58
38
|
* foo = any.unpack(Foo.class);
|
|
59
39
|
* }
|
|
60
40
|
*
|
|
61
|
-
*
|
|
41
|
+
* Example 3: Pack and unpack a message in Python.
|
|
62
42
|
*
|
|
63
43
|
* foo = Foo(...)
|
|
64
44
|
* any = Any()
|
|
@@ -68,7 +48,7 @@ import { Message, proto3 } from "../../index.js";
|
|
|
68
48
|
* any.Unpack(foo)
|
|
69
49
|
* ...
|
|
70
50
|
*
|
|
71
|
-
*
|
|
51
|
+
* Example 4: Pack and unpack a message in Go
|
|
72
52
|
*
|
|
73
53
|
* foo := &pb.Foo{...}
|
|
74
54
|
* any, err := anypb.New(foo)
|
|
@@ -89,7 +69,7 @@ import { Message, proto3 } from "../../index.js";
|
|
|
89
69
|
*
|
|
90
70
|
*
|
|
91
71
|
* JSON
|
|
92
|
-
*
|
|
72
|
+
*
|
|
93
73
|
* The JSON representation of an `Any` value uses the regular
|
|
94
74
|
* representation of the deserialized, embedded message, with an
|
|
95
75
|
* additional field `@type` which contains the type URL. Example:
|
|
@@ -1,36 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
// @generated by protoc-gen-es v0.0.2-alpha.2 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts"
|
|
3
|
-
// @generated from file google/protobuf/api.proto (package google.protobuf, syntax proto3)
|
|
1
|
+
// Copyright 2021-2022 Buf Technologies, Inc.
|
|
4
2
|
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
8
6
|
//
|
|
9
|
-
//
|
|
10
|
-
// modification, are permitted provided that the following conditions are
|
|
11
|
-
// met:
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
12
8
|
//
|
|
13
|
-
//
|
|
14
|
-
//
|
|
15
|
-
//
|
|
16
|
-
//
|
|
17
|
-
//
|
|
18
|
-
// distribution.
|
|
19
|
-
// * Neither the name of Google Inc. nor the names of its
|
|
20
|
-
// contributors may be used to endorse or promote products derived from
|
|
21
|
-
// this software without specific prior written permission.
|
|
22
|
-
//
|
|
23
|
-
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
24
|
-
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
25
|
-
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
26
|
-
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
27
|
-
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
28
|
-
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
29
|
-
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
30
|
-
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
31
|
-
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
32
|
-
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
33
|
-
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
34
14
|
import { Message, proto3 } from "../../index.js";
|
|
35
15
|
import { Option, Syntax } from "./type_pb.js";
|
|
36
16
|
import { SourceContext } from "./source_context_pb.js";
|
|
@@ -1,51 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
// @generated by protoc-gen-es v0.0.2-alpha.2 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts"
|
|
3
|
-
// @generated from file google/protobuf/compiler/plugin.proto (package google.protobuf.compiler, syntax proto2)
|
|
1
|
+
// Copyright 2021-2022 Buf Technologies, Inc.
|
|
4
2
|
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
8
6
|
//
|
|
9
|
-
//
|
|
10
|
-
// modification, are permitted provided that the following conditions are
|
|
11
|
-
// met:
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
12
8
|
//
|
|
13
|
-
//
|
|
14
|
-
//
|
|
15
|
-
//
|
|
16
|
-
//
|
|
17
|
-
//
|
|
18
|
-
// distribution.
|
|
19
|
-
// * Neither the name of Google Inc. nor the names of its
|
|
20
|
-
// contributors may be used to endorse or promote products derived from
|
|
21
|
-
// this software without specific prior written permission.
|
|
22
|
-
//
|
|
23
|
-
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
24
|
-
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
25
|
-
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
26
|
-
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
27
|
-
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
28
|
-
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
29
|
-
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
30
|
-
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
31
|
-
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
32
|
-
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
33
|
-
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
34
|
-
// Author: kenton@google.com (Kenton Varda)
|
|
35
|
-
//
|
|
36
|
-
// WARNING: The plugin interface is currently EXPERIMENTAL and is subject to
|
|
37
|
-
// change.
|
|
38
|
-
//
|
|
39
|
-
// protoc (aka the Protocol Compiler) can be extended via plugins. A plugin is
|
|
40
|
-
// just a program that reads a CodeGeneratorRequest from stdin and writes a
|
|
41
|
-
// CodeGeneratorResponse to stdout.
|
|
42
|
-
//
|
|
43
|
-
// Plugins written using C++ can use google/protobuf/compiler/plugin.h instead
|
|
44
|
-
// of dealing with the raw protocol defined here.
|
|
45
|
-
//
|
|
46
|
-
// A plugin executable needs only to be placed somewhere in the path. The
|
|
47
|
-
// plugin should be named "protoc-gen-$NAME", and will then be used when the
|
|
48
|
-
// flag "--${NAME}_out" is passed to protoc.
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
49
14
|
import { Message, proto2 } from "../../../index.js";
|
|
50
15
|
import { FileDescriptorProto, GeneratedCodeInfo } from "../descriptor_pb.js";
|
|
51
16
|
/**
|
|
@@ -1,43 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
// @generated by protoc-gen-es v0.0.2-alpha.2 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts"
|
|
3
|
-
// @generated from file google/protobuf/descriptor.proto (package google.protobuf, syntax proto2)
|
|
1
|
+
// Copyright 2021-2022 Buf Technologies, Inc.
|
|
4
2
|
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
8
6
|
//
|
|
9
|
-
//
|
|
10
|
-
// modification, are permitted provided that the following conditions are
|
|
11
|
-
// met:
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
12
8
|
//
|
|
13
|
-
//
|
|
14
|
-
//
|
|
15
|
-
//
|
|
16
|
-
//
|
|
17
|
-
//
|
|
18
|
-
// distribution.
|
|
19
|
-
// * Neither the name of Google Inc. nor the names of its
|
|
20
|
-
// contributors may be used to endorse or promote products derived from
|
|
21
|
-
// this software without specific prior written permission.
|
|
22
|
-
//
|
|
23
|
-
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
24
|
-
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
25
|
-
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
26
|
-
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
27
|
-
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
28
|
-
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
29
|
-
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
30
|
-
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
31
|
-
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
32
|
-
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
33
|
-
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
34
|
-
// Author: kenton@google.com (Kenton Varda)
|
|
35
|
-
// Based on original Protocol Buffers design by
|
|
36
|
-
// Sanjay Ghemawat, Jeff Dean, and others.
|
|
37
|
-
//
|
|
38
|
-
// The messages in this file describe the definitions found in .proto files.
|
|
39
|
-
// A valid .proto file can be translated directly to a FileDescriptorProto
|
|
40
|
-
// without any other information (e.g. without reading its imports).
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
41
14
|
import { Message, proto2 } from "../../index.js";
|
|
42
15
|
/**
|
|
43
16
|
* The protocol compiler can output a FileDescriptorSet containing the .proto
|
|
@@ -864,6 +837,7 @@ FieldOptions.fields = proto2.util.newFieldList(() => [
|
|
|
864
837
|
{ no: 2, name: "packed", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
|
|
865
838
|
{ no: 6, name: "jstype", kind: "enum", T: proto2.getEnumType(FieldOptions_JSType), opt: true, default: FieldOptions_JSType.JS_NORMAL },
|
|
866
839
|
{ no: 5, name: "lazy", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: false },
|
|
840
|
+
{ no: 15, name: "unverified_lazy", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: false },
|
|
867
841
|
{ no: 3, name: "deprecated", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: false },
|
|
868
842
|
{ no: 10, name: "weak", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: false },
|
|
869
843
|
{ no: 999, name: "uninterpreted_option", kind: "message", T: UninterpretedOption, repeated: true },
|
|
@@ -1286,8 +1260,8 @@ export class SourceCodeInfo_Location extends Message {
|
|
|
1286
1260
|
* location.
|
|
1287
1261
|
*
|
|
1288
1262
|
* Each element is a field number or an index. They form a path from
|
|
1289
|
-
* the root FileDescriptorProto to the place where the definition.
|
|
1290
|
-
* example, this path:
|
|
1263
|
+
* the root FileDescriptorProto to the place where the definition occurs.
|
|
1264
|
+
* For example, this path:
|
|
1291
1265
|
* [ 4, 3, 2, 7, 1 ]
|
|
1292
1266
|
* refers to:
|
|
1293
1267
|
* file.message_type(3) // 4, 3
|
|
@@ -1,36 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
// @generated by protoc-gen-es v0.0.2-alpha.2 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts"
|
|
3
|
-
// @generated from file google/protobuf/duration.proto (package google.protobuf, syntax proto3)
|
|
1
|
+
// Copyright 2021-2022 Buf Technologies, Inc.
|
|
4
2
|
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
8
6
|
//
|
|
9
|
-
//
|
|
10
|
-
// modification, are permitted provided that the following conditions are
|
|
11
|
-
// met:
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
12
8
|
//
|
|
13
|
-
//
|
|
14
|
-
//
|
|
15
|
-
//
|
|
16
|
-
//
|
|
17
|
-
//
|
|
18
|
-
// distribution.
|
|
19
|
-
// * Neither the name of Google Inc. nor the names of its
|
|
20
|
-
// contributors may be used to endorse or promote products derived from
|
|
21
|
-
// this software without specific prior written permission.
|
|
22
|
-
//
|
|
23
|
-
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
24
|
-
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
25
|
-
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
26
|
-
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
27
|
-
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
28
|
-
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
29
|
-
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
30
|
-
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
31
|
-
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
32
|
-
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
33
|
-
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
34
14
|
import { Message, proto3, protoInt64 } from "../../index.js";
|
|
35
15
|
/**
|
|
36
16
|
* A Duration represents a signed, fixed-length span of time represented
|