@miradorlabs/web-grpc 2.45.0 → 2.48.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,209 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.12.3
4
+ // protoc v3.21.12
5
+ // source: google/protobuf/duration.proto
6
+
7
+ /* eslint-disable */
8
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
9
+
10
+ export const protobufPackage = "google.protobuf";
11
+
12
+ /**
13
+ * A Duration represents a signed, fixed-length span of time represented
14
+ * as a count of seconds and fractions of seconds at nanosecond
15
+ * resolution. It is independent of any calendar and concepts like "day"
16
+ * or "month". It is related to Timestamp in that the difference between
17
+ * two Timestamp values is a Duration and it can be added or subtracted
18
+ * from a Timestamp. Range is approximately +-10,000 years.
19
+ *
20
+ * # Examples
21
+ *
22
+ * Example 1: Compute Duration from two Timestamps in pseudo code.
23
+ *
24
+ * Timestamp start = ...;
25
+ * Timestamp end = ...;
26
+ * Duration duration = ...;
27
+ *
28
+ * duration.seconds = end.seconds - start.seconds;
29
+ * duration.nanos = end.nanos - start.nanos;
30
+ *
31
+ * if (duration.seconds < 0 && duration.nanos > 0) {
32
+ * duration.seconds += 1;
33
+ * duration.nanos -= 1000000000;
34
+ * } else if (duration.seconds > 0 && duration.nanos < 0) {
35
+ * duration.seconds -= 1;
36
+ * duration.nanos += 1000000000;
37
+ * }
38
+ *
39
+ * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
40
+ *
41
+ * Timestamp start = ...;
42
+ * Duration duration = ...;
43
+ * Timestamp end = ...;
44
+ *
45
+ * end.seconds = start.seconds + duration.seconds;
46
+ * end.nanos = start.nanos + duration.nanos;
47
+ *
48
+ * if (end.nanos < 0) {
49
+ * end.seconds -= 1;
50
+ * end.nanos += 1000000000;
51
+ * } else if (end.nanos >= 1000000000) {
52
+ * end.seconds += 1;
53
+ * end.nanos -= 1000000000;
54
+ * }
55
+ *
56
+ * Example 3: Compute Duration from datetime.timedelta in Python.
57
+ *
58
+ * td = datetime.timedelta(days=3, minutes=10)
59
+ * duration = Duration()
60
+ * duration.FromTimedelta(td)
61
+ *
62
+ * # JSON Mapping
63
+ *
64
+ * In JSON format, the Duration type is encoded as a string rather than an
65
+ * object, where the string ends in the suffix "s" (indicating seconds) and
66
+ * is preceded by the number of seconds, with nanoseconds expressed as
67
+ * fractional seconds. For example, 3 seconds with 0 nanoseconds should be
68
+ * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
69
+ * be expressed in JSON format as "3.000000001s", and 3 seconds and 1
70
+ * microsecond should be expressed in JSON format as "3.000001s".
71
+ */
72
+ export interface Duration {
73
+ /**
74
+ * Signed seconds of the span of time. Must be from -315,576,000,000
75
+ * to +315,576,000,000 inclusive. Note: these bounds are computed from:
76
+ * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
77
+ */
78
+ seconds: number;
79
+ /**
80
+ * Signed fractions of a second at nanosecond resolution of the span
81
+ * of time. Durations less than one second are represented with a 0
82
+ * `seconds` field and a positive or negative `nanos` field. For durations
83
+ * of one second or more, a non-zero value for the `nanos` field must be
84
+ * of the same sign as the `seconds` field. Must be from -999,999,999
85
+ * to +999,999,999 inclusive.
86
+ */
87
+ nanos: number;
88
+ }
89
+
90
+ function createBaseDuration(): Duration {
91
+ return { seconds: 0, nanos: 0 };
92
+ }
93
+
94
+ export const Duration: MessageFns<Duration> = {
95
+ encode(message: Duration, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
96
+ if (message.seconds !== 0) {
97
+ writer.uint32(8).int64(message.seconds);
98
+ }
99
+ if (message.nanos !== 0) {
100
+ writer.uint32(16).int32(message.nanos);
101
+ }
102
+ return writer;
103
+ },
104
+
105
+ decode(input: BinaryReader | Uint8Array, length?: number): Duration {
106
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
107
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
108
+ if (previousRecursionDepth >= 100) {
109
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
110
+ }
111
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
112
+ try {
113
+ const end = length === undefined ? reader.len : reader.pos + length;
114
+ const message = createBaseDuration();
115
+ while (reader.pos < end) {
116
+ const tag = reader.uint32();
117
+ switch (tag >>> 3) {
118
+ case 1: {
119
+ if (tag !== 8) {
120
+ break;
121
+ }
122
+
123
+ message.seconds = longToNumber(reader.int64());
124
+ continue;
125
+ }
126
+ case 2: {
127
+ if (tag !== 16) {
128
+ break;
129
+ }
130
+
131
+ message.nanos = reader.int32();
132
+ continue;
133
+ }
134
+ }
135
+ if ((tag & 7) === 4 || tag === 0) {
136
+ break;
137
+ }
138
+ reader.skip(tag & 7);
139
+ }
140
+ return message;
141
+ } finally {
142
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
143
+ }
144
+ },
145
+
146
+ fromJSON(object: any): Duration {
147
+ return {
148
+ seconds: isSet(object.seconds) ? globalThis.Number(object.seconds) : 0,
149
+ nanos: isSet(object.nanos) ? globalThis.Number(object.nanos) : 0,
150
+ };
151
+ },
152
+
153
+ toJSON(message: Duration): unknown {
154
+ const obj: any = {};
155
+ if (message.seconds !== 0) {
156
+ obj.seconds = Math.round(message.seconds);
157
+ }
158
+ if (message.nanos !== 0) {
159
+ obj.nanos = Math.round(message.nanos);
160
+ }
161
+ return obj;
162
+ },
163
+
164
+ create<I extends Exact<DeepPartial<Duration>, I>>(base?: I): Duration {
165
+ return Duration.fromPartial(base ?? ({} as any));
166
+ },
167
+ fromPartial<I extends Exact<DeepPartial<Duration>, I>>(object: I): Duration {
168
+ const message = createBaseDuration();
169
+ message.seconds = object.seconds ?? 0;
170
+ message.nanos = object.nanos ?? 0;
171
+ return message;
172
+ },
173
+ };
174
+
175
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
176
+
177
+ export type DeepPartial<T> = T extends Builtin ? T
178
+ : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
179
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
180
+ : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
181
+ : Partial<T>;
182
+
183
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
184
+ export type Exact<P, I extends P> = P extends Builtin ? P
185
+ : P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
186
+
187
+ function longToNumber(int64: { toString(): string }): number {
188
+ const num = globalThis.Number(int64.toString());
189
+ if (num > globalThis.Number.MAX_SAFE_INTEGER) {
190
+ throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
191
+ }
192
+ if (num < globalThis.Number.MIN_SAFE_INTEGER) {
193
+ throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
194
+ }
195
+ return num;
196
+ }
197
+
198
+ function isSet(value: any): boolean {
199
+ return value !== null && value !== undefined;
200
+ }
201
+
202
+ export interface MessageFns<T> {
203
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
204
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
205
+ fromJSON(object: any): T;
206
+ toJSON(message: T): unknown;
207
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
208
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
209
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@miradorlabs/web-grpc",
3
- "version": "2.45.0",
3
+ "version": "2.48.0",
4
4
  "description": "Generated gRPC (grpc-js) client stubs for the Mirador web gateway.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -13,13 +13,7 @@
13
13
 
14
14
  var jspb = require('google-protobuf');
15
15
  var goog = jspb;
16
- var global =
17
- (typeof globalThis !== 'undefined' && globalThis) ||
18
- (typeof window !== 'undefined' && window) ||
19
- (typeof global !== 'undefined' && global) ||
20
- (typeof self !== 'undefined' && self) ||
21
- (function () { return this; }).call(null) ||
22
- Function('return this')();
16
+ var global = globalThis;
23
17
 
24
18
  goog.exportSymbol('proto.gateway.common.v1.AttributeArray', null, global);
25
19
  goog.exportSymbol('proto.gateway.common.v1.AttributeKeyValue', null, global);
@@ -192,7 +186,7 @@ kvlistValue: (f = msg.getKvlistValue()) && proto.gateway.common.v1.AttributeKeyV
192
186
 
193
187
  /**
194
188
  * Deserializes binary data (in protobuf wire format).
195
- * @param {jspb.ByteSource} bytes The bytes to deserialize.
189
+ * @param {jspb.binary.bytesource.ByteSource} bytes The bytes to deserialize.
196
190
  * @return {!proto.gateway.common.v1.AttributeValue}
197
191
  */
198
192
  proto.gateway.common.v1.AttributeValue.deserializeBinary = function(bytes) {
@@ -217,7 +211,7 @@ proto.gateway.common.v1.AttributeValue.deserializeBinaryFromReader = function(ms
217
211
  var field = reader.getFieldNumber();
218
212
  switch (field) {
219
213
  case 1:
220
- var value = /** @type {string} */ (reader.readString());
214
+ var value = /** @type {string} */ (reader.readStringRequireUtf8());
221
215
  msg.setStringValue(value);
222
216
  break;
223
217
  case 2:
@@ -660,7 +654,7 @@ valuesList: jspb.Message.toObjectList(msg.getValuesList(),
660
654
 
661
655
  /**
662
656
  * Deserializes binary data (in protobuf wire format).
663
- * @param {jspb.ByteSource} bytes The bytes to deserialize.
657
+ * @param {jspb.binary.bytesource.ByteSource} bytes The bytes to deserialize.
664
658
  * @return {!proto.gateway.common.v1.AttributeArray}
665
659
  */
666
660
  proto.gateway.common.v1.AttributeArray.deserializeBinary = function(bytes) {
@@ -813,7 +807,7 @@ value: (f = msg.getValue()) && proto.gateway.common.v1.AttributeValue.toObject(i
813
807
 
814
808
  /**
815
809
  * Deserializes binary data (in protobuf wire format).
816
- * @param {jspb.ByteSource} bytes The bytes to deserialize.
810
+ * @param {jspb.binary.bytesource.ByteSource} bytes The bytes to deserialize.
817
811
  * @return {!proto.gateway.common.v1.AttributeKeyValue}
818
812
  */
819
813
  proto.gateway.common.v1.AttributeKeyValue.deserializeBinary = function(bytes) {
@@ -838,7 +832,7 @@ proto.gateway.common.v1.AttributeKeyValue.deserializeBinaryFromReader = function
838
832
  var field = reader.getFieldNumber();
839
833
  switch (field) {
840
834
  case 1:
841
- var value = /** @type {string} */ (reader.readString());
835
+ var value = /** @type {string} */ (reader.readStringRequireUtf8());
842
836
  msg.setKey(value);
843
837
  break;
844
838
  case 2:
@@ -1001,7 +995,7 @@ valuesList: jspb.Message.toObjectList(msg.getValuesList(),
1001
995
 
1002
996
  /**
1003
997
  * Deserializes binary data (in protobuf wire format).
1004
- * @param {jspb.ByteSource} bytes The bytes to deserialize.
998
+ * @param {jspb.binary.bytesource.ByteSource} bytes The bytes to deserialize.
1005
999
  * @return {!proto.gateway.common.v1.AttributeKeyValueList}
1006
1000
  */
1007
1001
  proto.gateway.common.v1.AttributeKeyValueList.deserializeBinary = function(bytes) {
@@ -13,13 +13,7 @@
13
13
 
14
14
  var jspb = require('google-protobuf');
15
15
  var goog = jspb;
16
- var global =
17
- (typeof globalThis !== 'undefined' && globalThis) ||
18
- (typeof window !== 'undefined' && window) ||
19
- (typeof global !== 'undefined' && global) ||
20
- (typeof self !== 'undefined' && self) ||
21
- (function () { return this; }).call(null) ||
22
- Function('return this')();
16
+ var global = globalThis;
23
17
 
24
18
  goog.exportSymbol('proto.gateway.common.v1.ResponseStatus', null, global);
25
19
  goog.exportSymbol('proto.gateway.common.v1.ResponseStatus.StatusCode', null, global);
@@ -90,7 +84,7 @@ errorMessage: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f
90
84
 
91
85
  /**
92
86
  * Deserializes binary data (in protobuf wire format).
93
- * @param {jspb.ByteSource} bytes The bytes to deserialize.
87
+ * @param {jspb.binary.bytesource.ByteSource} bytes The bytes to deserialize.
94
88
  * @return {!proto.gateway.common.v1.ResponseStatus}
95
89
  */
96
90
  proto.gateway.common.v1.ResponseStatus.deserializeBinary = function(bytes) {
@@ -119,7 +113,7 @@ proto.gateway.common.v1.ResponseStatus.deserializeBinaryFromReader = function(ms
119
113
  msg.setCode(value);
120
114
  break;
121
115
  case 2:
122
- var value = /** @type {string} */ (reader.readString());
116
+ var value = /** @type {string} */ (reader.readStringRequireUtf8());
123
117
  msg.setErrorMessage(value);
124
118
  break;
125
119
  default:
@@ -13,13 +13,7 @@
13
13
 
14
14
  var jspb = require('google-protobuf');
15
15
  var goog = jspb;
16
- var global =
17
- (typeof globalThis !== 'undefined' && globalThis) ||
18
- (typeof window !== 'undefined' && window) ||
19
- (typeof global !== 'undefined' && global) ||
20
- (typeof self !== 'undefined' && self) ||
21
- (function () { return this; }).call(null) ||
22
- Function('return this')();
16
+ var global = globalThis;
23
17
 
24
18
  goog.exportSymbol('proto.gateway.common.v1.BridgeLegType', null, global);
25
19
  goog.exportSymbol('proto.gateway.common.v1.ChainDetails', null, global);
@@ -90,7 +84,7 @@ evmChainId: jspb.Message.getFieldWithDefault(msg, 2, 0)
90
84
 
91
85
  /**
92
86
  * Deserializes binary data (in protobuf wire format).
93
- * @param {jspb.ByteSource} bytes The bytes to deserialize.
87
+ * @param {jspb.binary.bytesource.ByteSource} bytes The bytes to deserialize.
94
88
  * @return {!proto.gateway.common.v1.ChainDetails}
95
89
  */
96
90
  proto.gateway.common.v1.ChainDetails.deserializeBinary = function(bytes) {
@@ -115,7 +109,7 @@ proto.gateway.common.v1.ChainDetails.deserializeBinaryFromReader = function(msg,
115
109
  var field = reader.getFieldNumber();
116
110
  switch (field) {
117
111
  case 1:
118
- var value = /** @type {string} */ (reader.readString());
112
+ var value = /** @type {string} */ (reader.readStringRequireUtf8());
119
113
  msg.setChainName(value);
120
114
  break;
121
115
  case 2: