@bufbuild/protobuf 0.0.2-alpha.2 → 0.0.4
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/README.md +5 -2
- package/dist/cjs/descriptor-registry.js +13 -0
- package/dist/cjs/google/protobuf/any_pb.js +19 -39
- package/dist/cjs/google/protobuf/api_pb.js +28 -48
- package/dist/cjs/google/protobuf/compiler/plugin_pb.js +32 -67
- package/dist/cjs/google/protobuf/descriptor_pb.js +161 -187
- package/dist/cjs/google/protobuf/duration_pb.js +21 -41
- package/dist/cjs/google/protobuf/empty_pb.js +16 -36
- package/dist/cjs/google/protobuf/field_mask_pb.js +17 -37
- package/dist/cjs/google/protobuf/source_context_pb.js +16 -36
- package/dist/cjs/google/protobuf/struct_pb.js +31 -51
- package/dist/cjs/google/protobuf/timestamp_pb.js +20 -40
- package/dist/cjs/google/protobuf/type_pb.js +43 -63
- package/dist/cjs/google/protobuf/wrappers_pb.js +76 -105
- package/dist/cjs/index-runtime.js +42 -0
- package/dist/cjs/index-wkt.js +42 -0
- package/dist/cjs/index.js +4 -38
- package/dist/cjs/private/json-format-common.js +3 -3
- package/dist/cjs/private/util-common.js +1 -1
- package/dist/cjs/proto-base64.js +138 -0
- package/dist/esm/descriptor-registry.js +13 -0
- package/dist/esm/google/protobuf/any_pb.js +14 -34
- package/dist/esm/google/protobuf/api_pb.js +11 -31
- package/dist/esm/google/protobuf/compiler/plugin_pb.js +11 -46
- package/dist/esm/google/protobuf/descriptor_pb.js +14 -40
- package/dist/esm/google/protobuf/duration_pb.js +11 -31
- package/dist/esm/google/protobuf/empty_pb.js +11 -31
- package/dist/esm/google/protobuf/field_mask_pb.js +11 -31
- package/dist/esm/google/protobuf/source_context_pb.js +11 -31
- package/dist/esm/google/protobuf/struct_pb.js +11 -31
- package/dist/esm/google/protobuf/timestamp_pb.js +11 -31
- package/dist/esm/google/protobuf/type_pb.js +11 -31
- package/dist/esm/google/protobuf/wrappers_pb.js +11 -40
- package/dist/esm/index-runtime.js +25 -0
- package/dist/esm/index-wkt.js +26 -0
- package/dist/esm/index.js +4 -24
- package/dist/esm/private/json-format-common.js +3 -3
- package/dist/esm/private/util-common.js +1 -1
- package/dist/esm/proto-base64.js +135 -0
- package/dist/types/descriptor-registry.d.ts +7 -0
- package/dist/types/google/protobuf/any_pb.d.ts +5 -5
- package/dist/types/google/protobuf/api_pb.d.ts +2 -2
- package/dist/types/google/protobuf/compiler/plugin_pb.d.ts +2 -2
- package/dist/types/google/protobuf/descriptor_pb.d.ts +18 -5
- package/dist/types/google/protobuf/duration_pb.d.ts +2 -2
- package/dist/types/google/protobuf/empty_pb.d.ts +2 -2
- package/dist/types/google/protobuf/field_mask_pb.d.ts +2 -2
- package/dist/types/google/protobuf/source_context_pb.d.ts +2 -2
- package/dist/types/google/protobuf/struct_pb.d.ts +2 -2
- package/dist/types/google/protobuf/timestamp_pb.d.ts +2 -2
- package/dist/types/google/protobuf/type_pb.d.ts +2 -2
- package/dist/types/google/protobuf/wrappers_pb.d.ts +2 -2
- package/dist/types/index-runtime.d.ts +19 -0
- package/dist/types/index-wkt.d.ts +12 -0
- package/dist/types/index.d.ts +2 -30
- package/dist/types/message-type.d.ts +2 -1
- package/dist/types/message.d.ts +4 -6
- package/dist/types/private/util.d.ts +2 -2
- package/dist/types/proto-base64.d.ts +26 -0
- package/package.json +3 -2
- 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,40 +1,20 @@
|
|
|
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/duration.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.Duration = void 0;
|
|
37
|
-
const
|
|
17
|
+
const index_runtime_js_1 = require("../../index-runtime.js");
|
|
38
18
|
/**
|
|
39
19
|
* A Duration represents a signed, fixed-length span of time represented
|
|
40
20
|
* as a count of seconds and fractions of seconds at nanosecond
|
|
@@ -99,7 +79,7 @@ const index_js_1 = require("../../index.js");
|
|
|
99
79
|
*
|
|
100
80
|
* @generated from message google.protobuf.Duration
|
|
101
81
|
*/
|
|
102
|
-
class Duration extends
|
|
82
|
+
class Duration extends index_runtime_js_1.Message {
|
|
103
83
|
constructor(data) {
|
|
104
84
|
super();
|
|
105
85
|
/**
|
|
@@ -109,7 +89,7 @@ class Duration extends index_js_1.Message {
|
|
|
109
89
|
*
|
|
110
90
|
* @generated from field: int64 seconds = 1;
|
|
111
91
|
*/
|
|
112
|
-
this.seconds =
|
|
92
|
+
this.seconds = index_runtime_js_1.protoInt64.zero;
|
|
113
93
|
/**
|
|
114
94
|
* Signed fractions of a second at nanosecond resolution of the span
|
|
115
95
|
* of time. Durations less than one second are represented with a 0
|
|
@@ -121,21 +101,21 @@ class Duration extends index_js_1.Message {
|
|
|
121
101
|
* @generated from field: int32 nanos = 2;
|
|
122
102
|
*/
|
|
123
103
|
this.nanos = 0;
|
|
124
|
-
|
|
104
|
+
index_runtime_js_1.proto3.util.initPartial(data, this);
|
|
125
105
|
}
|
|
126
106
|
fromJson(json, options) {
|
|
127
107
|
if (typeof json !== "string") {
|
|
128
|
-
throw new Error(`cannot decode google.protobuf.Duration from JSON: ${
|
|
108
|
+
throw new Error(`cannot decode google.protobuf.Duration from JSON: ${index_runtime_js_1.proto3.json.debug(json)}`);
|
|
129
109
|
}
|
|
130
110
|
const match = json.match(/^(-?[0-9]+)(?:\.([0-9]+))?s/);
|
|
131
111
|
if (match === null) {
|
|
132
|
-
throw new Error(`cannot decode google.protobuf.Duration from JSON: ${
|
|
112
|
+
throw new Error(`cannot decode google.protobuf.Duration from JSON: ${index_runtime_js_1.proto3.json.debug(json)}`);
|
|
133
113
|
}
|
|
134
114
|
const longSeconds = Number(match[1]);
|
|
135
115
|
if (longSeconds > 315576000000 || longSeconds < -315576000000) {
|
|
136
|
-
throw new Error(`cannot decode google.protobuf.Duration from JSON: ${
|
|
116
|
+
throw new Error(`cannot decode google.protobuf.Duration from JSON: ${index_runtime_js_1.proto3.json.debug(json)}`);
|
|
137
117
|
}
|
|
138
|
-
this.seconds =
|
|
118
|
+
this.seconds = index_runtime_js_1.protoInt64.parse(longSeconds);
|
|
139
119
|
if (typeof match[2] == "string") {
|
|
140
120
|
const nanosStr = match[2] + "0".repeat(9 - match[2].length);
|
|
141
121
|
this.nanos = parseInt(nanosStr);
|
|
@@ -173,13 +153,13 @@ class Duration extends index_js_1.Message {
|
|
|
173
153
|
return new Duration().fromJsonString(jsonString, options);
|
|
174
154
|
}
|
|
175
155
|
static equals(a, b) {
|
|
176
|
-
return
|
|
156
|
+
return index_runtime_js_1.proto3.util.equals(Duration, a, b);
|
|
177
157
|
}
|
|
178
158
|
}
|
|
179
159
|
exports.Duration = Duration;
|
|
180
|
-
Duration.runtime =
|
|
160
|
+
Duration.runtime = index_runtime_js_1.proto3;
|
|
181
161
|
Duration.typeName = "google.protobuf.Duration";
|
|
182
|
-
Duration.fields =
|
|
162
|
+
Duration.fields = index_runtime_js_1.proto3.util.newFieldList(() => [
|
|
183
163
|
{ no: 1, name: "seconds", kind: "scalar", T: 3 /* ScalarType.INT64 */ },
|
|
184
164
|
{ no: 2, name: "nanos", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
|
|
185
165
|
]);
|
|
@@ -1,40 +1,20 @@
|
|
|
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/empty.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.Empty = void 0;
|
|
37
|
-
const
|
|
17
|
+
const index_runtime_js_1 = require("../../index-runtime.js");
|
|
38
18
|
/**
|
|
39
19
|
* A generic empty message that you can re-use to avoid defining duplicated
|
|
40
20
|
* empty messages in your APIs. A typical example is to use it as the request
|
|
@@ -48,10 +28,10 @@ const index_js_1 = require("../../index.js");
|
|
|
48
28
|
*
|
|
49
29
|
* @generated from message google.protobuf.Empty
|
|
50
30
|
*/
|
|
51
|
-
class Empty extends
|
|
31
|
+
class Empty extends index_runtime_js_1.Message {
|
|
52
32
|
constructor(data) {
|
|
53
33
|
super();
|
|
54
|
-
|
|
34
|
+
index_runtime_js_1.proto3.util.initPartial(data, this);
|
|
55
35
|
}
|
|
56
36
|
static fromBinary(bytes, options) {
|
|
57
37
|
return new Empty().fromBinary(bytes, options);
|
|
@@ -63,10 +43,10 @@ class Empty extends index_js_1.Message {
|
|
|
63
43
|
return new Empty().fromJsonString(jsonString, options);
|
|
64
44
|
}
|
|
65
45
|
static equals(a, b) {
|
|
66
|
-
return
|
|
46
|
+
return index_runtime_js_1.proto3.util.equals(Empty, a, b);
|
|
67
47
|
}
|
|
68
48
|
}
|
|
69
49
|
exports.Empty = Empty;
|
|
70
|
-
Empty.runtime =
|
|
50
|
+
Empty.runtime = index_runtime_js_1.proto3;
|
|
71
51
|
Empty.typeName = "google.protobuf.Empty";
|
|
72
|
-
Empty.fields =
|
|
52
|
+
Empty.fields = index_runtime_js_1.proto3.util.newFieldList(() => []);
|
|
@@ -1,40 +1,20 @@
|
|
|
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/field_mask.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.FieldMask = void 0;
|
|
37
|
-
const
|
|
17
|
+
const index_runtime_js_1 = require("../../index-runtime.js");
|
|
38
18
|
/**
|
|
39
19
|
* `FieldMask` represents a set of symbolic field paths, for example:
|
|
40
20
|
*
|
|
@@ -238,7 +218,7 @@ const index_js_1 = require("../../index.js");
|
|
|
238
218
|
*
|
|
239
219
|
* @generated from message google.protobuf.FieldMask
|
|
240
220
|
*/
|
|
241
|
-
class FieldMask extends
|
|
221
|
+
class FieldMask extends index_runtime_js_1.Message {
|
|
242
222
|
constructor(data) {
|
|
243
223
|
super();
|
|
244
224
|
/**
|
|
@@ -247,7 +227,7 @@ class FieldMask extends index_js_1.Message {
|
|
|
247
227
|
* @generated from field: repeated string paths = 1;
|
|
248
228
|
*/
|
|
249
229
|
this.paths = [];
|
|
250
|
-
|
|
230
|
+
index_runtime_js_1.proto3.util.initPartial(data, this);
|
|
251
231
|
}
|
|
252
232
|
toJson(options) {
|
|
253
233
|
// Converts snake_case to protoCamelCase according to the convention
|
|
@@ -294,7 +274,7 @@ class FieldMask extends index_js_1.Message {
|
|
|
294
274
|
}
|
|
295
275
|
fromJson(json, options) {
|
|
296
276
|
if (typeof json !== "string") {
|
|
297
|
-
throw new Error("cannot decode google.protobuf.FieldMask from JSON: " +
|
|
277
|
+
throw new Error("cannot decode google.protobuf.FieldMask from JSON: " + index_runtime_js_1.proto3.json.debug(json));
|
|
298
278
|
}
|
|
299
279
|
if (json === "") {
|
|
300
280
|
return this;
|
|
@@ -319,12 +299,12 @@ class FieldMask extends index_js_1.Message {
|
|
|
319
299
|
return new FieldMask().fromJsonString(jsonString, options);
|
|
320
300
|
}
|
|
321
301
|
static equals(a, b) {
|
|
322
|
-
return
|
|
302
|
+
return index_runtime_js_1.proto3.util.equals(FieldMask, a, b);
|
|
323
303
|
}
|
|
324
304
|
}
|
|
325
305
|
exports.FieldMask = FieldMask;
|
|
326
|
-
FieldMask.runtime =
|
|
306
|
+
FieldMask.runtime = index_runtime_js_1.proto3;
|
|
327
307
|
FieldMask.typeName = "google.protobuf.FieldMask";
|
|
328
|
-
FieldMask.fields =
|
|
308
|
+
FieldMask.fields = index_runtime_js_1.proto3.util.newFieldList(() => [
|
|
329
309
|
{ no: 1, name: "paths", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true },
|
|
330
310
|
]);
|
|
@@ -1,47 +1,27 @@
|
|
|
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/source_context.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.SourceContext = void 0;
|
|
37
|
-
const
|
|
17
|
+
const index_runtime_js_1 = require("../../index-runtime.js");
|
|
38
18
|
/**
|
|
39
19
|
* `SourceContext` represents information about the source of a
|
|
40
20
|
* protobuf element, like the file in which it is defined.
|
|
41
21
|
*
|
|
42
22
|
* @generated from message google.protobuf.SourceContext
|
|
43
23
|
*/
|
|
44
|
-
class SourceContext extends
|
|
24
|
+
class SourceContext extends index_runtime_js_1.Message {
|
|
45
25
|
constructor(data) {
|
|
46
26
|
super();
|
|
47
27
|
/**
|
|
@@ -51,7 +31,7 @@ class SourceContext extends index_js_1.Message {
|
|
|
51
31
|
* @generated from field: string file_name = 1;
|
|
52
32
|
*/
|
|
53
33
|
this.fileName = "";
|
|
54
|
-
|
|
34
|
+
index_runtime_js_1.proto3.util.initPartial(data, this);
|
|
55
35
|
}
|
|
56
36
|
static fromBinary(bytes, options) {
|
|
57
37
|
return new SourceContext().fromBinary(bytes, options);
|
|
@@ -63,12 +43,12 @@ class SourceContext extends index_js_1.Message {
|
|
|
63
43
|
return new SourceContext().fromJsonString(jsonString, options);
|
|
64
44
|
}
|
|
65
45
|
static equals(a, b) {
|
|
66
|
-
return
|
|
46
|
+
return index_runtime_js_1.proto3.util.equals(SourceContext, a, b);
|
|
67
47
|
}
|
|
68
48
|
}
|
|
69
49
|
exports.SourceContext = SourceContext;
|
|
70
|
-
SourceContext.runtime =
|
|
50
|
+
SourceContext.runtime = index_runtime_js_1.proto3;
|
|
71
51
|
SourceContext.typeName = "google.protobuf.SourceContext";
|
|
72
|
-
SourceContext.fields =
|
|
52
|
+
SourceContext.fields = index_runtime_js_1.proto3.util.newFieldList(() => [
|
|
73
53
|
{ no: 1, name: "file_name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
74
54
|
]);
|
|
@@ -1,40 +1,20 @@
|
|
|
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/struct.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.ListValue = exports.Value = exports.Struct = exports.NullValue = void 0;
|
|
37
|
-
const
|
|
17
|
+
const index_runtime_js_1 = require("../../index-runtime.js");
|
|
38
18
|
/**
|
|
39
19
|
* `NullValue` is a singleton enumeration to represent the null value for the
|
|
40
20
|
* `Value` type union.
|
|
@@ -53,7 +33,7 @@ var NullValue;
|
|
|
53
33
|
NullValue[NullValue["NULL_VALUE"] = 0] = "NULL_VALUE";
|
|
54
34
|
})(NullValue = exports.NullValue || (exports.NullValue = {}));
|
|
55
35
|
// Retrieve enum metadata with: proto3.getEnumType(NullValue)
|
|
56
|
-
|
|
36
|
+
index_runtime_js_1.proto3.util.setEnumType(NullValue, "google.protobuf.NullValue", [
|
|
57
37
|
{ no: 0, name: "NULL_VALUE" },
|
|
58
38
|
]);
|
|
59
39
|
/**
|
|
@@ -68,7 +48,7 @@ index_js_1.proto3.util.setEnumType(NullValue, "google.protobuf.NullValue", [
|
|
|
68
48
|
*
|
|
69
49
|
* @generated from message google.protobuf.Struct
|
|
70
50
|
*/
|
|
71
|
-
class Struct extends
|
|
51
|
+
class Struct extends index_runtime_js_1.Message {
|
|
72
52
|
constructor(data) {
|
|
73
53
|
super();
|
|
74
54
|
/**
|
|
@@ -77,7 +57,7 @@ class Struct extends index_js_1.Message {
|
|
|
77
57
|
* @generated from field: map<string, google.protobuf.Value> fields = 1;
|
|
78
58
|
*/
|
|
79
59
|
this.fields = {};
|
|
80
|
-
|
|
60
|
+
index_runtime_js_1.proto3.util.initPartial(data, this);
|
|
81
61
|
}
|
|
82
62
|
toJson(options) {
|
|
83
63
|
const json = {};
|
|
@@ -88,7 +68,7 @@ class Struct extends index_js_1.Message {
|
|
|
88
68
|
}
|
|
89
69
|
fromJson(json, options) {
|
|
90
70
|
if (typeof json != "object" || json == null || Array.isArray(json)) {
|
|
91
|
-
throw new Error("cannot decode google.protobuf.Struct from JSON " +
|
|
71
|
+
throw new Error("cannot decode google.protobuf.Struct from JSON " + index_runtime_js_1.proto3.json.debug(json));
|
|
92
72
|
}
|
|
93
73
|
for (const [k, v] of Object.entries(json)) {
|
|
94
74
|
this.fields[k] = Value.fromJson(v);
|
|
@@ -105,13 +85,13 @@ class Struct extends index_js_1.Message {
|
|
|
105
85
|
return new Struct().fromJsonString(jsonString, options);
|
|
106
86
|
}
|
|
107
87
|
static equals(a, b) {
|
|
108
|
-
return
|
|
88
|
+
return index_runtime_js_1.proto3.util.equals(Struct, a, b);
|
|
109
89
|
}
|
|
110
90
|
}
|
|
111
91
|
exports.Struct = Struct;
|
|
112
|
-
Struct.runtime =
|
|
92
|
+
Struct.runtime = index_runtime_js_1.proto3;
|
|
113
93
|
Struct.typeName = "google.protobuf.Struct";
|
|
114
|
-
Struct.fields =
|
|
94
|
+
Struct.fields = index_runtime_js_1.proto3.util.newFieldList(() => [
|
|
115
95
|
{ no: 1, name: "fields", kind: "map", K: 9 /* ScalarType.STRING */, V: { kind: "message", T: Value } },
|
|
116
96
|
]);
|
|
117
97
|
/**
|
|
@@ -124,7 +104,7 @@ Struct.fields = index_js_1.proto3.util.newFieldList(() => [
|
|
|
124
104
|
*
|
|
125
105
|
* @generated from message google.protobuf.Value
|
|
126
106
|
*/
|
|
127
|
-
class Value extends
|
|
107
|
+
class Value extends index_runtime_js_1.Message {
|
|
128
108
|
constructor(data) {
|
|
129
109
|
super();
|
|
130
110
|
/**
|
|
@@ -133,7 +113,7 @@ class Value extends index_js_1.Message {
|
|
|
133
113
|
* @generated from oneof google.protobuf.Value.kind
|
|
134
114
|
*/
|
|
135
115
|
this.kind = { case: undefined };
|
|
136
|
-
|
|
116
|
+
index_runtime_js_1.proto3.util.initPartial(data, this);
|
|
137
117
|
}
|
|
138
118
|
toJson(options) {
|
|
139
119
|
switch (this.kind.case) {
|
|
@@ -172,7 +152,7 @@ class Value extends index_js_1.Message {
|
|
|
172
152
|
}
|
|
173
153
|
break;
|
|
174
154
|
default:
|
|
175
|
-
throw new Error("cannot decode google.protobuf.Value from JSON " +
|
|
155
|
+
throw new Error("cannot decode google.protobuf.Value from JSON " + index_runtime_js_1.proto3.json.debug(json));
|
|
176
156
|
}
|
|
177
157
|
return this;
|
|
178
158
|
}
|
|
@@ -186,14 +166,14 @@ class Value extends index_js_1.Message {
|
|
|
186
166
|
return new Value().fromJsonString(jsonString, options);
|
|
187
167
|
}
|
|
188
168
|
static equals(a, b) {
|
|
189
|
-
return
|
|
169
|
+
return index_runtime_js_1.proto3.util.equals(Value, a, b);
|
|
190
170
|
}
|
|
191
171
|
}
|
|
192
172
|
exports.Value = Value;
|
|
193
|
-
Value.runtime =
|
|
173
|
+
Value.runtime = index_runtime_js_1.proto3;
|
|
194
174
|
Value.typeName = "google.protobuf.Value";
|
|
195
|
-
Value.fields =
|
|
196
|
-
{ no: 1, name: "null_value", kind: "enum", T:
|
|
175
|
+
Value.fields = index_runtime_js_1.proto3.util.newFieldList(() => [
|
|
176
|
+
{ no: 1, name: "null_value", kind: "enum", T: index_runtime_js_1.proto3.getEnumType(NullValue), oneof: "kind" },
|
|
197
177
|
{ no: 2, name: "number_value", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, oneof: "kind" },
|
|
198
178
|
{ no: 3, name: "string_value", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "kind" },
|
|
199
179
|
{ no: 4, name: "bool_value", kind: "scalar", T: 8 /* ScalarType.BOOL */, oneof: "kind" },
|
|
@@ -207,7 +187,7 @@ Value.fields = index_js_1.proto3.util.newFieldList(() => [
|
|
|
207
187
|
*
|
|
208
188
|
* @generated from message google.protobuf.ListValue
|
|
209
189
|
*/
|
|
210
|
-
class ListValue extends
|
|
190
|
+
class ListValue extends index_runtime_js_1.Message {
|
|
211
191
|
constructor(data) {
|
|
212
192
|
super();
|
|
213
193
|
/**
|
|
@@ -216,14 +196,14 @@ class ListValue extends index_js_1.Message {
|
|
|
216
196
|
* @generated from field: repeated google.protobuf.Value values = 1;
|
|
217
197
|
*/
|
|
218
198
|
this.values = [];
|
|
219
|
-
|
|
199
|
+
index_runtime_js_1.proto3.util.initPartial(data, this);
|
|
220
200
|
}
|
|
221
201
|
toJson(options) {
|
|
222
202
|
return this.values.map(v => v.toJson());
|
|
223
203
|
}
|
|
224
204
|
fromJson(json, options) {
|
|
225
205
|
if (!Array.isArray(json)) {
|
|
226
|
-
throw new Error("cannot decode google.protobuf.ListValue from JSON " +
|
|
206
|
+
throw new Error("cannot decode google.protobuf.ListValue from JSON " + index_runtime_js_1.proto3.json.debug(json));
|
|
227
207
|
}
|
|
228
208
|
for (let e of json) {
|
|
229
209
|
this.values.push(Value.fromJson(e));
|
|
@@ -240,12 +220,12 @@ class ListValue extends index_js_1.Message {
|
|
|
240
220
|
return new ListValue().fromJsonString(jsonString, options);
|
|
241
221
|
}
|
|
242
222
|
static equals(a, b) {
|
|
243
|
-
return
|
|
223
|
+
return index_runtime_js_1.proto3.util.equals(ListValue, a, b);
|
|
244
224
|
}
|
|
245
225
|
}
|
|
246
226
|
exports.ListValue = ListValue;
|
|
247
|
-
ListValue.runtime =
|
|
227
|
+
ListValue.runtime = index_runtime_js_1.proto3;
|
|
248
228
|
ListValue.typeName = "google.protobuf.ListValue";
|
|
249
|
-
ListValue.fields =
|
|
229
|
+
ListValue.fields = index_runtime_js_1.proto3.util.newFieldList(() => [
|
|
250
230
|
{ no: 1, name: "values", kind: "message", T: Value, repeated: true },
|
|
251
231
|
]);
|