@bufbuild/protobuf 0.0.5 → 0.0.6
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 +7 -6
- package/dist/cjs/google/protobuf/api_pb.js +19 -18
- package/dist/cjs/google/protobuf/compiler/plugin_pb.js +23 -22
- package/dist/cjs/google/protobuf/descriptor_pb.js +149 -148
- package/dist/cjs/google/protobuf/duration_pb.js +13 -11
- package/dist/cjs/google/protobuf/empty_pb.js +7 -6
- package/dist/cjs/google/protobuf/field_mask_pb.js +8 -7
- package/dist/cjs/google/protobuf/source_context_pb.js +7 -6
- package/dist/cjs/google/protobuf/struct_pb.js +25 -21
- package/dist/cjs/google/protobuf/timestamp_pb.js +12 -10
- package/dist/cjs/google/protobuf/type_pb.js +37 -33
- package/dist/cjs/google/protobuf/wrappers_pb.js +69 -66
- package/dist/cjs/index.js +40 -4
- package/dist/esm/google/protobuf/any_pb.js +2 -1
- package/dist/esm/google/protobuf/api_pb.js +2 -1
- package/dist/esm/google/protobuf/compiler/plugin_pb.js +2 -1
- package/dist/esm/google/protobuf/descriptor_pb.js +2 -1
- package/dist/esm/google/protobuf/duration_pb.js +3 -1
- package/dist/esm/google/protobuf/empty_pb.js +2 -1
- package/dist/esm/google/protobuf/field_mask_pb.js +2 -1
- package/dist/esm/google/protobuf/source_context_pb.js +2 -1
- package/dist/esm/google/protobuf/struct_pb.js +5 -1
- package/dist/esm/google/protobuf/timestamp_pb.js +3 -1
- package/dist/esm/google/protobuf/type_pb.js +5 -1
- package/dist/esm/google/protobuf/wrappers_pb.js +4 -1
- package/dist/esm/index.js +25 -4
- package/dist/types/google/protobuf/any_pb.d.ts +6 -2
- package/dist/types/google/protobuf/api_pb.d.ts +5 -2
- package/dist/types/google/protobuf/compiler/plugin_pb.d.ts +5 -2
- package/dist/types/google/protobuf/descriptor_pb.d.ts +5 -2
- package/dist/types/google/protobuf/duration_pb.d.ts +5 -2
- package/dist/types/google/protobuf/empty_pb.d.ts +5 -2
- package/dist/types/google/protobuf/field_mask_pb.d.ts +5 -2
- package/dist/types/google/protobuf/source_context_pb.d.ts +5 -2
- package/dist/types/google/protobuf/struct_pb.d.ts +5 -2
- package/dist/types/google/protobuf/timestamp_pb.d.ts +5 -2
- package/dist/types/google/protobuf/type_pb.d.ts +5 -2
- package/dist/types/google/protobuf/wrappers_pb.d.ts +5 -2
- package/dist/types/index.d.ts +31 -2
- package/package.json +1 -1
- package/dist/cjs/index-runtime.js +0 -42
- package/dist/cjs/index-wkt.js +0 -42
- package/dist/esm/index-runtime.js +0 -25
- package/dist/esm/index-wkt.js +0 -26
- package/dist/types/index-runtime.d.ts +0 -19
- package/dist/types/index-wkt.d.ts +0 -12
|
@@ -14,7 +14,9 @@
|
|
|
14
14
|
// limitations under the License.
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.Duration = void 0;
|
|
17
|
-
const
|
|
17
|
+
const message_js_1 = require("../../message.js");
|
|
18
|
+
const proto_int64_js_1 = require("../../proto-int64.js");
|
|
19
|
+
const proto3_js_1 = require("../../proto3.js");
|
|
18
20
|
/**
|
|
19
21
|
* A Duration represents a signed, fixed-length span of time represented
|
|
20
22
|
* as a count of seconds and fractions of seconds at nanosecond
|
|
@@ -79,7 +81,7 @@ const index_runtime_js_1 = require("../../index-runtime.js");
|
|
|
79
81
|
*
|
|
80
82
|
* @generated from message google.protobuf.Duration
|
|
81
83
|
*/
|
|
82
|
-
class Duration extends
|
|
84
|
+
class Duration extends message_js_1.Message {
|
|
83
85
|
constructor(data) {
|
|
84
86
|
super();
|
|
85
87
|
/**
|
|
@@ -89,7 +91,7 @@ class Duration extends index_runtime_js_1.Message {
|
|
|
89
91
|
*
|
|
90
92
|
* @generated from field: int64 seconds = 1;
|
|
91
93
|
*/
|
|
92
|
-
this.seconds =
|
|
94
|
+
this.seconds = proto_int64_js_1.protoInt64.zero;
|
|
93
95
|
/**
|
|
94
96
|
* Signed fractions of a second at nanosecond resolution of the span
|
|
95
97
|
* of time. Durations less than one second are represented with a 0
|
|
@@ -101,21 +103,21 @@ class Duration extends index_runtime_js_1.Message {
|
|
|
101
103
|
* @generated from field: int32 nanos = 2;
|
|
102
104
|
*/
|
|
103
105
|
this.nanos = 0;
|
|
104
|
-
|
|
106
|
+
proto3_js_1.proto3.util.initPartial(data, this);
|
|
105
107
|
}
|
|
106
108
|
fromJson(json, options) {
|
|
107
109
|
if (typeof json !== "string") {
|
|
108
|
-
throw new Error(`cannot decode google.protobuf.Duration from JSON: ${
|
|
110
|
+
throw new Error(`cannot decode google.protobuf.Duration from JSON: ${proto3_js_1.proto3.json.debug(json)}`);
|
|
109
111
|
}
|
|
110
112
|
const match = json.match(/^(-?[0-9]+)(?:\.([0-9]+))?s/);
|
|
111
113
|
if (match === null) {
|
|
112
|
-
throw new Error(`cannot decode google.protobuf.Duration from JSON: ${
|
|
114
|
+
throw new Error(`cannot decode google.protobuf.Duration from JSON: ${proto3_js_1.proto3.json.debug(json)}`);
|
|
113
115
|
}
|
|
114
116
|
const longSeconds = Number(match[1]);
|
|
115
117
|
if (longSeconds > 315576000000 || longSeconds < -315576000000) {
|
|
116
|
-
throw new Error(`cannot decode google.protobuf.Duration from JSON: ${
|
|
118
|
+
throw new Error(`cannot decode google.protobuf.Duration from JSON: ${proto3_js_1.proto3.json.debug(json)}`);
|
|
117
119
|
}
|
|
118
|
-
this.seconds =
|
|
120
|
+
this.seconds = proto_int64_js_1.protoInt64.parse(longSeconds);
|
|
119
121
|
if (typeof match[2] == "string") {
|
|
120
122
|
const nanosStr = match[2] + "0".repeat(9 - match[2].length);
|
|
121
123
|
this.nanos = parseInt(nanosStr);
|
|
@@ -153,13 +155,13 @@ class Duration extends index_runtime_js_1.Message {
|
|
|
153
155
|
return new Duration().fromJsonString(jsonString, options);
|
|
154
156
|
}
|
|
155
157
|
static equals(a, b) {
|
|
156
|
-
return
|
|
158
|
+
return proto3_js_1.proto3.util.equals(Duration, a, b);
|
|
157
159
|
}
|
|
158
160
|
}
|
|
159
161
|
exports.Duration = Duration;
|
|
160
|
-
Duration.runtime =
|
|
162
|
+
Duration.runtime = proto3_js_1.proto3;
|
|
161
163
|
Duration.typeName = "google.protobuf.Duration";
|
|
162
|
-
Duration.fields =
|
|
164
|
+
Duration.fields = proto3_js_1.proto3.util.newFieldList(() => [
|
|
163
165
|
{ no: 1, name: "seconds", kind: "scalar", T: 3 /* ScalarType.INT64 */ },
|
|
164
166
|
{ no: 2, name: "nanos", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
|
|
165
167
|
]);
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
// limitations under the License.
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.Empty = void 0;
|
|
17
|
-
const
|
|
17
|
+
const message_js_1 = require("../../message.js");
|
|
18
|
+
const proto3_js_1 = require("../../proto3.js");
|
|
18
19
|
/**
|
|
19
20
|
* A generic empty message that you can re-use to avoid defining duplicated
|
|
20
21
|
* empty messages in your APIs. A typical example is to use it as the request
|
|
@@ -28,10 +29,10 @@ const index_runtime_js_1 = require("../../index-runtime.js");
|
|
|
28
29
|
*
|
|
29
30
|
* @generated from message google.protobuf.Empty
|
|
30
31
|
*/
|
|
31
|
-
class Empty extends
|
|
32
|
+
class Empty extends message_js_1.Message {
|
|
32
33
|
constructor(data) {
|
|
33
34
|
super();
|
|
34
|
-
|
|
35
|
+
proto3_js_1.proto3.util.initPartial(data, this);
|
|
35
36
|
}
|
|
36
37
|
static fromBinary(bytes, options) {
|
|
37
38
|
return new Empty().fromBinary(bytes, options);
|
|
@@ -43,10 +44,10 @@ class Empty extends index_runtime_js_1.Message {
|
|
|
43
44
|
return new Empty().fromJsonString(jsonString, options);
|
|
44
45
|
}
|
|
45
46
|
static equals(a, b) {
|
|
46
|
-
return
|
|
47
|
+
return proto3_js_1.proto3.util.equals(Empty, a, b);
|
|
47
48
|
}
|
|
48
49
|
}
|
|
49
50
|
exports.Empty = Empty;
|
|
50
|
-
Empty.runtime =
|
|
51
|
+
Empty.runtime = proto3_js_1.proto3;
|
|
51
52
|
Empty.typeName = "google.protobuf.Empty";
|
|
52
|
-
Empty.fields =
|
|
53
|
+
Empty.fields = proto3_js_1.proto3.util.newFieldList(() => []);
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
// limitations under the License.
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.FieldMask = void 0;
|
|
17
|
-
const
|
|
17
|
+
const message_js_1 = require("../../message.js");
|
|
18
|
+
const proto3_js_1 = require("../../proto3.js");
|
|
18
19
|
/**
|
|
19
20
|
* `FieldMask` represents a set of symbolic field paths, for example:
|
|
20
21
|
*
|
|
@@ -218,7 +219,7 @@ const index_runtime_js_1 = require("../../index-runtime.js");
|
|
|
218
219
|
*
|
|
219
220
|
* @generated from message google.protobuf.FieldMask
|
|
220
221
|
*/
|
|
221
|
-
class FieldMask extends
|
|
222
|
+
class FieldMask extends message_js_1.Message {
|
|
222
223
|
constructor(data) {
|
|
223
224
|
super();
|
|
224
225
|
/**
|
|
@@ -227,7 +228,7 @@ class FieldMask extends index_runtime_js_1.Message {
|
|
|
227
228
|
* @generated from field: repeated string paths = 1;
|
|
228
229
|
*/
|
|
229
230
|
this.paths = [];
|
|
230
|
-
|
|
231
|
+
proto3_js_1.proto3.util.initPartial(data, this);
|
|
231
232
|
}
|
|
232
233
|
toJson(options) {
|
|
233
234
|
// Converts snake_case to protoCamelCase according to the convention
|
|
@@ -274,7 +275,7 @@ class FieldMask extends index_runtime_js_1.Message {
|
|
|
274
275
|
}
|
|
275
276
|
fromJson(json, options) {
|
|
276
277
|
if (typeof json !== "string") {
|
|
277
|
-
throw new Error("cannot decode google.protobuf.FieldMask from JSON: " +
|
|
278
|
+
throw new Error("cannot decode google.protobuf.FieldMask from JSON: " + proto3_js_1.proto3.json.debug(json));
|
|
278
279
|
}
|
|
279
280
|
if (json === "") {
|
|
280
281
|
return this;
|
|
@@ -299,12 +300,12 @@ class FieldMask extends index_runtime_js_1.Message {
|
|
|
299
300
|
return new FieldMask().fromJsonString(jsonString, options);
|
|
300
301
|
}
|
|
301
302
|
static equals(a, b) {
|
|
302
|
-
return
|
|
303
|
+
return proto3_js_1.proto3.util.equals(FieldMask, a, b);
|
|
303
304
|
}
|
|
304
305
|
}
|
|
305
306
|
exports.FieldMask = FieldMask;
|
|
306
|
-
FieldMask.runtime =
|
|
307
|
+
FieldMask.runtime = proto3_js_1.proto3;
|
|
307
308
|
FieldMask.typeName = "google.protobuf.FieldMask";
|
|
308
|
-
FieldMask.fields =
|
|
309
|
+
FieldMask.fields = proto3_js_1.proto3.util.newFieldList(() => [
|
|
309
310
|
{ no: 1, name: "paths", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true },
|
|
310
311
|
]);
|
|
@@ -14,14 +14,15 @@
|
|
|
14
14
|
// limitations under the License.
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.SourceContext = void 0;
|
|
17
|
-
const
|
|
17
|
+
const message_js_1 = require("../../message.js");
|
|
18
|
+
const proto3_js_1 = require("../../proto3.js");
|
|
18
19
|
/**
|
|
19
20
|
* `SourceContext` represents information about the source of a
|
|
20
21
|
* protobuf element, like the file in which it is defined.
|
|
21
22
|
*
|
|
22
23
|
* @generated from message google.protobuf.SourceContext
|
|
23
24
|
*/
|
|
24
|
-
class SourceContext extends
|
|
25
|
+
class SourceContext extends message_js_1.Message {
|
|
25
26
|
constructor(data) {
|
|
26
27
|
super();
|
|
27
28
|
/**
|
|
@@ -31,7 +32,7 @@ class SourceContext extends index_runtime_js_1.Message {
|
|
|
31
32
|
* @generated from field: string file_name = 1;
|
|
32
33
|
*/
|
|
33
34
|
this.fileName = "";
|
|
34
|
-
|
|
35
|
+
proto3_js_1.proto3.util.initPartial(data, this);
|
|
35
36
|
}
|
|
36
37
|
static fromBinary(bytes, options) {
|
|
37
38
|
return new SourceContext().fromBinary(bytes, options);
|
|
@@ -43,12 +44,12 @@ class SourceContext extends index_runtime_js_1.Message {
|
|
|
43
44
|
return new SourceContext().fromJsonString(jsonString, options);
|
|
44
45
|
}
|
|
45
46
|
static equals(a, b) {
|
|
46
|
-
return
|
|
47
|
+
return proto3_js_1.proto3.util.equals(SourceContext, a, b);
|
|
47
48
|
}
|
|
48
49
|
}
|
|
49
50
|
exports.SourceContext = SourceContext;
|
|
50
|
-
SourceContext.runtime =
|
|
51
|
+
SourceContext.runtime = proto3_js_1.proto3;
|
|
51
52
|
SourceContext.typeName = "google.protobuf.SourceContext";
|
|
52
|
-
SourceContext.fields =
|
|
53
|
+
SourceContext.fields = proto3_js_1.proto3.util.newFieldList(() => [
|
|
53
54
|
{ no: 1, name: "file_name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
54
55
|
]);
|
|
@@ -14,7 +14,11 @@
|
|
|
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
|
-
|
|
17
|
+
// @generated by protoc-gen-es v0.0.6 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts"
|
|
18
|
+
// @generated from file google/protobuf/struct.proto (package google.protobuf, syntax proto3)
|
|
19
|
+
/* eslint-disable */
|
|
20
|
+
const proto3_js_1 = require("../../proto3.js");
|
|
21
|
+
const message_js_1 = require("../../message.js");
|
|
18
22
|
/**
|
|
19
23
|
* `NullValue` is a singleton enumeration to represent the null value for the
|
|
20
24
|
* `Value` type union.
|
|
@@ -33,7 +37,7 @@ var NullValue;
|
|
|
33
37
|
NullValue[NullValue["NULL_VALUE"] = 0] = "NULL_VALUE";
|
|
34
38
|
})(NullValue = exports.NullValue || (exports.NullValue = {}));
|
|
35
39
|
// Retrieve enum metadata with: proto3.getEnumType(NullValue)
|
|
36
|
-
|
|
40
|
+
proto3_js_1.proto3.util.setEnumType(NullValue, "google.protobuf.NullValue", [
|
|
37
41
|
{ no: 0, name: "NULL_VALUE" },
|
|
38
42
|
]);
|
|
39
43
|
/**
|
|
@@ -48,7 +52,7 @@ index_runtime_js_1.proto3.util.setEnumType(NullValue, "google.protobuf.NullValue
|
|
|
48
52
|
*
|
|
49
53
|
* @generated from message google.protobuf.Struct
|
|
50
54
|
*/
|
|
51
|
-
class Struct extends
|
|
55
|
+
class Struct extends message_js_1.Message {
|
|
52
56
|
constructor(data) {
|
|
53
57
|
super();
|
|
54
58
|
/**
|
|
@@ -57,7 +61,7 @@ class Struct extends index_runtime_js_1.Message {
|
|
|
57
61
|
* @generated from field: map<string, google.protobuf.Value> fields = 1;
|
|
58
62
|
*/
|
|
59
63
|
this.fields = {};
|
|
60
|
-
|
|
64
|
+
proto3_js_1.proto3.util.initPartial(data, this);
|
|
61
65
|
}
|
|
62
66
|
toJson(options) {
|
|
63
67
|
const json = {};
|
|
@@ -68,7 +72,7 @@ class Struct extends index_runtime_js_1.Message {
|
|
|
68
72
|
}
|
|
69
73
|
fromJson(json, options) {
|
|
70
74
|
if (typeof json != "object" || json == null || Array.isArray(json)) {
|
|
71
|
-
throw new Error("cannot decode google.protobuf.Struct from JSON " +
|
|
75
|
+
throw new Error("cannot decode google.protobuf.Struct from JSON " + proto3_js_1.proto3.json.debug(json));
|
|
72
76
|
}
|
|
73
77
|
for (const [k, v] of Object.entries(json)) {
|
|
74
78
|
this.fields[k] = Value.fromJson(v);
|
|
@@ -85,13 +89,13 @@ class Struct extends index_runtime_js_1.Message {
|
|
|
85
89
|
return new Struct().fromJsonString(jsonString, options);
|
|
86
90
|
}
|
|
87
91
|
static equals(a, b) {
|
|
88
|
-
return
|
|
92
|
+
return proto3_js_1.proto3.util.equals(Struct, a, b);
|
|
89
93
|
}
|
|
90
94
|
}
|
|
91
95
|
exports.Struct = Struct;
|
|
92
|
-
Struct.runtime =
|
|
96
|
+
Struct.runtime = proto3_js_1.proto3;
|
|
93
97
|
Struct.typeName = "google.protobuf.Struct";
|
|
94
|
-
Struct.fields =
|
|
98
|
+
Struct.fields = proto3_js_1.proto3.util.newFieldList(() => [
|
|
95
99
|
{ no: 1, name: "fields", kind: "map", K: 9 /* ScalarType.STRING */, V: { kind: "message", T: Value } },
|
|
96
100
|
]);
|
|
97
101
|
/**
|
|
@@ -104,7 +108,7 @@ Struct.fields = index_runtime_js_1.proto3.util.newFieldList(() => [
|
|
|
104
108
|
*
|
|
105
109
|
* @generated from message google.protobuf.Value
|
|
106
110
|
*/
|
|
107
|
-
class Value extends
|
|
111
|
+
class Value extends message_js_1.Message {
|
|
108
112
|
constructor(data) {
|
|
109
113
|
super();
|
|
110
114
|
/**
|
|
@@ -113,7 +117,7 @@ class Value extends index_runtime_js_1.Message {
|
|
|
113
117
|
* @generated from oneof google.protobuf.Value.kind
|
|
114
118
|
*/
|
|
115
119
|
this.kind = { case: undefined };
|
|
116
|
-
|
|
120
|
+
proto3_js_1.proto3.util.initPartial(data, this);
|
|
117
121
|
}
|
|
118
122
|
toJson(options) {
|
|
119
123
|
switch (this.kind.case) {
|
|
@@ -152,7 +156,7 @@ class Value extends index_runtime_js_1.Message {
|
|
|
152
156
|
}
|
|
153
157
|
break;
|
|
154
158
|
default:
|
|
155
|
-
throw new Error("cannot decode google.protobuf.Value from JSON " +
|
|
159
|
+
throw new Error("cannot decode google.protobuf.Value from JSON " + proto3_js_1.proto3.json.debug(json));
|
|
156
160
|
}
|
|
157
161
|
return this;
|
|
158
162
|
}
|
|
@@ -166,14 +170,14 @@ class Value extends index_runtime_js_1.Message {
|
|
|
166
170
|
return new Value().fromJsonString(jsonString, options);
|
|
167
171
|
}
|
|
168
172
|
static equals(a, b) {
|
|
169
|
-
return
|
|
173
|
+
return proto3_js_1.proto3.util.equals(Value, a, b);
|
|
170
174
|
}
|
|
171
175
|
}
|
|
172
176
|
exports.Value = Value;
|
|
173
|
-
Value.runtime =
|
|
177
|
+
Value.runtime = proto3_js_1.proto3;
|
|
174
178
|
Value.typeName = "google.protobuf.Value";
|
|
175
|
-
Value.fields =
|
|
176
|
-
{ no: 1, name: "null_value", kind: "enum", T:
|
|
179
|
+
Value.fields = proto3_js_1.proto3.util.newFieldList(() => [
|
|
180
|
+
{ no: 1, name: "null_value", kind: "enum", T: proto3_js_1.proto3.getEnumType(NullValue), oneof: "kind" },
|
|
177
181
|
{ no: 2, name: "number_value", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, oneof: "kind" },
|
|
178
182
|
{ no: 3, name: "string_value", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "kind" },
|
|
179
183
|
{ no: 4, name: "bool_value", kind: "scalar", T: 8 /* ScalarType.BOOL */, oneof: "kind" },
|
|
@@ -187,7 +191,7 @@ Value.fields = index_runtime_js_1.proto3.util.newFieldList(() => [
|
|
|
187
191
|
*
|
|
188
192
|
* @generated from message google.protobuf.ListValue
|
|
189
193
|
*/
|
|
190
|
-
class ListValue extends
|
|
194
|
+
class ListValue extends message_js_1.Message {
|
|
191
195
|
constructor(data) {
|
|
192
196
|
super();
|
|
193
197
|
/**
|
|
@@ -196,14 +200,14 @@ class ListValue extends index_runtime_js_1.Message {
|
|
|
196
200
|
* @generated from field: repeated google.protobuf.Value values = 1;
|
|
197
201
|
*/
|
|
198
202
|
this.values = [];
|
|
199
|
-
|
|
203
|
+
proto3_js_1.proto3.util.initPartial(data, this);
|
|
200
204
|
}
|
|
201
205
|
toJson(options) {
|
|
202
206
|
return this.values.map(v => v.toJson());
|
|
203
207
|
}
|
|
204
208
|
fromJson(json, options) {
|
|
205
209
|
if (!Array.isArray(json)) {
|
|
206
|
-
throw new Error("cannot decode google.protobuf.ListValue from JSON " +
|
|
210
|
+
throw new Error("cannot decode google.protobuf.ListValue from JSON " + proto3_js_1.proto3.json.debug(json));
|
|
207
211
|
}
|
|
208
212
|
for (let e of json) {
|
|
209
213
|
this.values.push(Value.fromJson(e));
|
|
@@ -220,12 +224,12 @@ class ListValue extends index_runtime_js_1.Message {
|
|
|
220
224
|
return new ListValue().fromJsonString(jsonString, options);
|
|
221
225
|
}
|
|
222
226
|
static equals(a, b) {
|
|
223
|
-
return
|
|
227
|
+
return proto3_js_1.proto3.util.equals(ListValue, a, b);
|
|
224
228
|
}
|
|
225
229
|
}
|
|
226
230
|
exports.ListValue = ListValue;
|
|
227
|
-
ListValue.runtime =
|
|
231
|
+
ListValue.runtime = proto3_js_1.proto3;
|
|
228
232
|
ListValue.typeName = "google.protobuf.ListValue";
|
|
229
|
-
ListValue.fields =
|
|
233
|
+
ListValue.fields = proto3_js_1.proto3.util.newFieldList(() => [
|
|
230
234
|
{ no: 1, name: "values", kind: "message", T: Value, repeated: true },
|
|
231
235
|
]);
|
|
@@ -14,7 +14,9 @@
|
|
|
14
14
|
// limitations under the License.
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.Timestamp = void 0;
|
|
17
|
-
const
|
|
17
|
+
const message_js_1 = require("../../message.js");
|
|
18
|
+
const proto_int64_js_1 = require("../../proto-int64.js");
|
|
19
|
+
const proto3_js_1 = require("../../proto3.js");
|
|
18
20
|
/**
|
|
19
21
|
* A Timestamp represents a point in time independent of any time zone or local
|
|
20
22
|
* calendar, encoded as a count of seconds and fractions of seconds at
|
|
@@ -112,7 +114,7 @@ const index_runtime_js_1 = require("../../index-runtime.js");
|
|
|
112
114
|
*
|
|
113
115
|
* @generated from message google.protobuf.Timestamp
|
|
114
116
|
*/
|
|
115
|
-
class Timestamp extends
|
|
117
|
+
class Timestamp extends message_js_1.Message {
|
|
116
118
|
constructor(data) {
|
|
117
119
|
super();
|
|
118
120
|
/**
|
|
@@ -122,7 +124,7 @@ class Timestamp extends index_runtime_js_1.Message {
|
|
|
122
124
|
*
|
|
123
125
|
* @generated from field: int64 seconds = 1;
|
|
124
126
|
*/
|
|
125
|
-
this.seconds =
|
|
127
|
+
this.seconds = proto_int64_js_1.protoInt64.zero;
|
|
126
128
|
/**
|
|
127
129
|
* Non-negative fractions of a second at nanosecond resolution. Negative
|
|
128
130
|
* second values with fractions must still have non-negative nanos values
|
|
@@ -132,11 +134,11 @@ class Timestamp extends index_runtime_js_1.Message {
|
|
|
132
134
|
* @generated from field: int32 nanos = 2;
|
|
133
135
|
*/
|
|
134
136
|
this.nanos = 0;
|
|
135
|
-
|
|
137
|
+
proto3_js_1.proto3.util.initPartial(data, this);
|
|
136
138
|
}
|
|
137
139
|
fromJson(json, options) {
|
|
138
140
|
if (typeof json !== "string") {
|
|
139
|
-
throw new Error(`cannot decode google.protobuf.Timestamp from JSON: ${
|
|
141
|
+
throw new Error(`cannot decode google.protobuf.Timestamp from JSON: ${proto3_js_1.proto3.json.debug(json)}`);
|
|
140
142
|
}
|
|
141
143
|
const matches = json.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:Z|\.([0-9]{3,9})Z|([+-][0-9][0-9]:[0-9][0-9]))$/);
|
|
142
144
|
if (!matches) {
|
|
@@ -149,7 +151,7 @@ class Timestamp extends index_runtime_js_1.Message {
|
|
|
149
151
|
if (ms < Date.parse("0001-01-01T00:00:00Z") || ms > Date.parse("9999-12-31T23:59:59Z")) {
|
|
150
152
|
throw new Error(`cannot decode message google.protobuf.Timestamp from JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive`);
|
|
151
153
|
}
|
|
152
|
-
this.seconds =
|
|
154
|
+
this.seconds = proto_int64_js_1.protoInt64.parse(ms / 1000);
|
|
153
155
|
this.nanos = 0;
|
|
154
156
|
if (matches[7]) {
|
|
155
157
|
this.nanos = (parseInt("1" + matches[7] + "0".repeat(9 - matches[7].length)) - 1000000000);
|
|
@@ -188,7 +190,7 @@ class Timestamp extends index_runtime_js_1.Message {
|
|
|
188
190
|
static fromDate(date) {
|
|
189
191
|
const ms = date.getTime();
|
|
190
192
|
return new Timestamp({
|
|
191
|
-
seconds:
|
|
193
|
+
seconds: proto_int64_js_1.protoInt64.parse(Math.floor(ms / 1000)),
|
|
192
194
|
nanos: (ms % 1000) * 1000000,
|
|
193
195
|
});
|
|
194
196
|
}
|
|
@@ -202,13 +204,13 @@ class Timestamp extends index_runtime_js_1.Message {
|
|
|
202
204
|
return new Timestamp().fromJsonString(jsonString, options);
|
|
203
205
|
}
|
|
204
206
|
static equals(a, b) {
|
|
205
|
-
return
|
|
207
|
+
return proto3_js_1.proto3.util.equals(Timestamp, a, b);
|
|
206
208
|
}
|
|
207
209
|
}
|
|
208
210
|
exports.Timestamp = Timestamp;
|
|
209
|
-
Timestamp.runtime =
|
|
211
|
+
Timestamp.runtime = proto3_js_1.proto3;
|
|
210
212
|
Timestamp.typeName = "google.protobuf.Timestamp";
|
|
211
|
-
Timestamp.fields =
|
|
213
|
+
Timestamp.fields = proto3_js_1.proto3.util.newFieldList(() => [
|
|
212
214
|
{ no: 1, name: "seconds", kind: "scalar", T: 3 /* ScalarType.INT64 */ },
|
|
213
215
|
{ no: 2, name: "nanos", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
|
|
214
216
|
]);
|
|
@@ -14,7 +14,11 @@
|
|
|
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
|
-
|
|
17
|
+
// @generated by protoc-gen-es v0.0.6 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts"
|
|
18
|
+
// @generated from file google/protobuf/type.proto (package google.protobuf, syntax proto3)
|
|
19
|
+
/* eslint-disable */
|
|
20
|
+
const proto3_js_1 = require("../../proto3.js");
|
|
21
|
+
const message_js_1 = require("../../message.js");
|
|
18
22
|
const source_context_pb_js_1 = require("./source_context_pb.js");
|
|
19
23
|
const any_pb_js_1 = require("./any_pb.js");
|
|
20
24
|
/**
|
|
@@ -38,7 +42,7 @@ var Syntax;
|
|
|
38
42
|
Syntax[Syntax["PROTO3"] = 1] = "PROTO3";
|
|
39
43
|
})(Syntax = exports.Syntax || (exports.Syntax = {}));
|
|
40
44
|
// Retrieve enum metadata with: proto3.getEnumType(Syntax)
|
|
41
|
-
|
|
45
|
+
proto3_js_1.proto3.util.setEnumType(Syntax, "google.protobuf.Syntax", [
|
|
42
46
|
{ no: 0, name: "SYNTAX_PROTO2" },
|
|
43
47
|
{ no: 1, name: "SYNTAX_PROTO3" },
|
|
44
48
|
]);
|
|
@@ -47,7 +51,7 @@ index_runtime_js_1.proto3.util.setEnumType(Syntax, "google.protobuf.Syntax", [
|
|
|
47
51
|
*
|
|
48
52
|
* @generated from message google.protobuf.Type
|
|
49
53
|
*/
|
|
50
|
-
class Type extends
|
|
54
|
+
class Type extends message_js_1.Message {
|
|
51
55
|
constructor(data) {
|
|
52
56
|
super();
|
|
53
57
|
/**
|
|
@@ -80,7 +84,7 @@ class Type extends index_runtime_js_1.Message {
|
|
|
80
84
|
* @generated from field: google.protobuf.Syntax syntax = 6;
|
|
81
85
|
*/
|
|
82
86
|
this.syntax = Syntax.PROTO2;
|
|
83
|
-
|
|
87
|
+
proto3_js_1.proto3.util.initPartial(data, this);
|
|
84
88
|
}
|
|
85
89
|
static fromBinary(bytes, options) {
|
|
86
90
|
return new Type().fromBinary(bytes, options);
|
|
@@ -92,26 +96,26 @@ class Type extends index_runtime_js_1.Message {
|
|
|
92
96
|
return new Type().fromJsonString(jsonString, options);
|
|
93
97
|
}
|
|
94
98
|
static equals(a, b) {
|
|
95
|
-
return
|
|
99
|
+
return proto3_js_1.proto3.util.equals(Type, a, b);
|
|
96
100
|
}
|
|
97
101
|
}
|
|
98
102
|
exports.Type = Type;
|
|
99
|
-
Type.runtime =
|
|
103
|
+
Type.runtime = proto3_js_1.proto3;
|
|
100
104
|
Type.typeName = "google.protobuf.Type";
|
|
101
|
-
Type.fields =
|
|
105
|
+
Type.fields = proto3_js_1.proto3.util.newFieldList(() => [
|
|
102
106
|
{ no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
103
107
|
{ no: 2, name: "fields", kind: "message", T: Field, repeated: true },
|
|
104
108
|
{ no: 3, name: "oneofs", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true },
|
|
105
109
|
{ no: 4, name: "options", kind: "message", T: Option, repeated: true },
|
|
106
110
|
{ no: 5, name: "source_context", kind: "message", T: source_context_pb_js_1.SourceContext },
|
|
107
|
-
{ no: 6, name: "syntax", kind: "enum", T:
|
|
111
|
+
{ no: 6, name: "syntax", kind: "enum", T: proto3_js_1.proto3.getEnumType(Syntax) },
|
|
108
112
|
]);
|
|
109
113
|
/**
|
|
110
114
|
* A single field of a message type.
|
|
111
115
|
*
|
|
112
116
|
* @generated from message google.protobuf.Field
|
|
113
117
|
*/
|
|
114
|
-
class Field extends
|
|
118
|
+
class Field extends message_js_1.Message {
|
|
115
119
|
constructor(data) {
|
|
116
120
|
super();
|
|
117
121
|
/**
|
|
@@ -176,7 +180,7 @@ class Field extends index_runtime_js_1.Message {
|
|
|
176
180
|
* @generated from field: string default_value = 11;
|
|
177
181
|
*/
|
|
178
182
|
this.defaultValue = "";
|
|
179
|
-
|
|
183
|
+
proto3_js_1.proto3.util.initPartial(data, this);
|
|
180
184
|
}
|
|
181
185
|
static fromBinary(bytes, options) {
|
|
182
186
|
return new Field().fromBinary(bytes, options);
|
|
@@ -188,15 +192,15 @@ class Field extends index_runtime_js_1.Message {
|
|
|
188
192
|
return new Field().fromJsonString(jsonString, options);
|
|
189
193
|
}
|
|
190
194
|
static equals(a, b) {
|
|
191
|
-
return
|
|
195
|
+
return proto3_js_1.proto3.util.equals(Field, a, b);
|
|
192
196
|
}
|
|
193
197
|
}
|
|
194
198
|
exports.Field = Field;
|
|
195
|
-
Field.runtime =
|
|
199
|
+
Field.runtime = proto3_js_1.proto3;
|
|
196
200
|
Field.typeName = "google.protobuf.Field";
|
|
197
|
-
Field.fields =
|
|
198
|
-
{ no: 1, name: "kind", kind: "enum", T:
|
|
199
|
-
{ no: 2, name: "cardinality", kind: "enum", T:
|
|
201
|
+
Field.fields = proto3_js_1.proto3.util.newFieldList(() => [
|
|
202
|
+
{ no: 1, name: "kind", kind: "enum", T: proto3_js_1.proto3.getEnumType(Field_Kind) },
|
|
203
|
+
{ no: 2, name: "cardinality", kind: "enum", T: proto3_js_1.proto3.getEnumType(Field_Cardinality) },
|
|
200
204
|
{ no: 3, name: "number", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
|
|
201
205
|
{ no: 4, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
202
206
|
{ no: 6, name: "type_url", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
@@ -329,7 +333,7 @@ var Field_Kind;
|
|
|
329
333
|
Field_Kind[Field_Kind["TYPE_SINT64"] = 18] = "TYPE_SINT64";
|
|
330
334
|
})(Field_Kind = exports.Field_Kind || (exports.Field_Kind = {}));
|
|
331
335
|
// Retrieve enum metadata with: proto3.getEnumType(Field_Kind)
|
|
332
|
-
|
|
336
|
+
proto3_js_1.proto3.util.setEnumType(Field_Kind, "google.protobuf.Field.Kind", [
|
|
333
337
|
{ no: 0, name: "TYPE_UNKNOWN" },
|
|
334
338
|
{ no: 1, name: "TYPE_DOUBLE" },
|
|
335
339
|
{ no: 2, name: "TYPE_FLOAT" },
|
|
@@ -383,7 +387,7 @@ var Field_Cardinality;
|
|
|
383
387
|
Field_Cardinality[Field_Cardinality["REPEATED"] = 3] = "REPEATED";
|
|
384
388
|
})(Field_Cardinality = exports.Field_Cardinality || (exports.Field_Cardinality = {}));
|
|
385
389
|
// Retrieve enum metadata with: proto3.getEnumType(Field_Cardinality)
|
|
386
|
-
|
|
390
|
+
proto3_js_1.proto3.util.setEnumType(Field_Cardinality, "google.protobuf.Field.Cardinality", [
|
|
387
391
|
{ no: 0, name: "CARDINALITY_UNKNOWN" },
|
|
388
392
|
{ no: 1, name: "CARDINALITY_OPTIONAL" },
|
|
389
393
|
{ no: 2, name: "CARDINALITY_REQUIRED" },
|
|
@@ -394,7 +398,7 @@ index_runtime_js_1.proto3.util.setEnumType(Field_Cardinality, "google.protobuf.F
|
|
|
394
398
|
*
|
|
395
399
|
* @generated from message google.protobuf.Enum
|
|
396
400
|
*/
|
|
397
|
-
class Enum extends
|
|
401
|
+
class Enum extends message_js_1.Message {
|
|
398
402
|
constructor(data) {
|
|
399
403
|
super();
|
|
400
404
|
/**
|
|
@@ -421,7 +425,7 @@ class Enum extends index_runtime_js_1.Message {
|
|
|
421
425
|
* @generated from field: google.protobuf.Syntax syntax = 5;
|
|
422
426
|
*/
|
|
423
427
|
this.syntax = Syntax.PROTO2;
|
|
424
|
-
|
|
428
|
+
proto3_js_1.proto3.util.initPartial(data, this);
|
|
425
429
|
}
|
|
426
430
|
static fromBinary(bytes, options) {
|
|
427
431
|
return new Enum().fromBinary(bytes, options);
|
|
@@ -433,25 +437,25 @@ class Enum extends index_runtime_js_1.Message {
|
|
|
433
437
|
return new Enum().fromJsonString(jsonString, options);
|
|
434
438
|
}
|
|
435
439
|
static equals(a, b) {
|
|
436
|
-
return
|
|
440
|
+
return proto3_js_1.proto3.util.equals(Enum, a, b);
|
|
437
441
|
}
|
|
438
442
|
}
|
|
439
443
|
exports.Enum = Enum;
|
|
440
|
-
Enum.runtime =
|
|
444
|
+
Enum.runtime = proto3_js_1.proto3;
|
|
441
445
|
Enum.typeName = "google.protobuf.Enum";
|
|
442
|
-
Enum.fields =
|
|
446
|
+
Enum.fields = proto3_js_1.proto3.util.newFieldList(() => [
|
|
443
447
|
{ no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
444
448
|
{ no: 2, name: "enumvalue", kind: "message", T: EnumValue, repeated: true },
|
|
445
449
|
{ no: 3, name: "options", kind: "message", T: Option, repeated: true },
|
|
446
450
|
{ no: 4, name: "source_context", kind: "message", T: source_context_pb_js_1.SourceContext },
|
|
447
|
-
{ no: 5, name: "syntax", kind: "enum", T:
|
|
451
|
+
{ no: 5, name: "syntax", kind: "enum", T: proto3_js_1.proto3.getEnumType(Syntax) },
|
|
448
452
|
]);
|
|
449
453
|
/**
|
|
450
454
|
* Enum value definition.
|
|
451
455
|
*
|
|
452
456
|
* @generated from message google.protobuf.EnumValue
|
|
453
457
|
*/
|
|
454
|
-
class EnumValue extends
|
|
458
|
+
class EnumValue extends message_js_1.Message {
|
|
455
459
|
constructor(data) {
|
|
456
460
|
super();
|
|
457
461
|
/**
|
|
@@ -472,7 +476,7 @@ class EnumValue extends index_runtime_js_1.Message {
|
|
|
472
476
|
* @generated from field: repeated google.protobuf.Option options = 3;
|
|
473
477
|
*/
|
|
474
478
|
this.options = [];
|
|
475
|
-
|
|
479
|
+
proto3_js_1.proto3.util.initPartial(data, this);
|
|
476
480
|
}
|
|
477
481
|
static fromBinary(bytes, options) {
|
|
478
482
|
return new EnumValue().fromBinary(bytes, options);
|
|
@@ -484,13 +488,13 @@ class EnumValue extends index_runtime_js_1.Message {
|
|
|
484
488
|
return new EnumValue().fromJsonString(jsonString, options);
|
|
485
489
|
}
|
|
486
490
|
static equals(a, b) {
|
|
487
|
-
return
|
|
491
|
+
return proto3_js_1.proto3.util.equals(EnumValue, a, b);
|
|
488
492
|
}
|
|
489
493
|
}
|
|
490
494
|
exports.EnumValue = EnumValue;
|
|
491
|
-
EnumValue.runtime =
|
|
495
|
+
EnumValue.runtime = proto3_js_1.proto3;
|
|
492
496
|
EnumValue.typeName = "google.protobuf.EnumValue";
|
|
493
|
-
EnumValue.fields =
|
|
497
|
+
EnumValue.fields = proto3_js_1.proto3.util.newFieldList(() => [
|
|
494
498
|
{ no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
495
499
|
{ no: 2, name: "number", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
|
|
496
500
|
{ no: 3, name: "options", kind: "message", T: Option, repeated: true },
|
|
@@ -501,7 +505,7 @@ EnumValue.fields = index_runtime_js_1.proto3.util.newFieldList(() => [
|
|
|
501
505
|
*
|
|
502
506
|
* @generated from message google.protobuf.Option
|
|
503
507
|
*/
|
|
504
|
-
class Option extends
|
|
508
|
+
class Option extends message_js_1.Message {
|
|
505
509
|
constructor(data) {
|
|
506
510
|
super();
|
|
507
511
|
/**
|
|
@@ -513,7 +517,7 @@ class Option extends index_runtime_js_1.Message {
|
|
|
513
517
|
* @generated from field: string name = 1;
|
|
514
518
|
*/
|
|
515
519
|
this.name = "";
|
|
516
|
-
|
|
520
|
+
proto3_js_1.proto3.util.initPartial(data, this);
|
|
517
521
|
}
|
|
518
522
|
static fromBinary(bytes, options) {
|
|
519
523
|
return new Option().fromBinary(bytes, options);
|
|
@@ -525,13 +529,13 @@ class Option extends index_runtime_js_1.Message {
|
|
|
525
529
|
return new Option().fromJsonString(jsonString, options);
|
|
526
530
|
}
|
|
527
531
|
static equals(a, b) {
|
|
528
|
-
return
|
|
532
|
+
return proto3_js_1.proto3.util.equals(Option, a, b);
|
|
529
533
|
}
|
|
530
534
|
}
|
|
531
535
|
exports.Option = Option;
|
|
532
|
-
Option.runtime =
|
|
536
|
+
Option.runtime = proto3_js_1.proto3;
|
|
533
537
|
Option.typeName = "google.protobuf.Option";
|
|
534
|
-
Option.fields =
|
|
538
|
+
Option.fields = proto3_js_1.proto3.util.newFieldList(() => [
|
|
535
539
|
{ no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
536
540
|
{ no: 2, name: "value", kind: "message", T: any_pb_js_1.Any },
|
|
537
541
|
]);
|