@milaboratories/pl-client 2.7.14 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/client.d.ts +4 -1
- package/dist/core/client.d.ts.map +1 -1
- package/dist/core/ll_client.d.ts +12 -2
- package/dist/core/ll_client.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4341 -4316
- package/dist/index.mjs.map +1 -1
- package/dist/proto/github.com/googleapis/googleapis/google/rpc/status.d.ts +15 -15
- package/dist/proto/github.com/googleapis/googleapis/google/rpc/status.d.ts.map +1 -1
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.client.d.ts +4 -4
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.client.d.ts.map +1 -1
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.d.ts +59 -59
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.d.ts.map +1 -1
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.client.d.ts +72 -72
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.client.d.ts.map +1 -1
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.d.ts +152 -152
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.d.ts.map +1 -1
- package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api.client.d.ts +156 -156
- package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api.client.d.ts.map +1 -1
- package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api.d.ts +790 -773
- package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api.d.ts.map +1 -1
- package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api_types.d.ts +163 -163
- package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api_types.d.ts.map +1 -1
- package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/base_types.d.ts +22 -22
- package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/base_types.d.ts.map +1 -1
- package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/import.d.ts +32 -32
- package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/import.d.ts.map +1 -1
- package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/resource_types.d.ts +78 -78
- package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/resource_types.d.ts.map +1 -1
- package/dist/proto/google/protobuf/any.d.ts +52 -52
- package/dist/proto/google/protobuf/any.d.ts.map +1 -1
- package/dist/proto/google/protobuf/duration.d.ts +19 -19
- package/dist/proto/google/protobuf/duration.d.ts.map +1 -1
- package/dist/proto/google/protobuf/empty.d.ts.map +1 -1
- package/dist/proto/google/protobuf/struct.d.ts +56 -56
- package/dist/proto/google/protobuf/struct.d.ts.map +1 -1
- package/dist/proto/google/protobuf/timestamp.d.ts +25 -25
- package/dist/proto/google/protobuf/timestamp.d.ts.map +1 -1
- package/dist/proto/google/protobuf/wrappers.d.ts +72 -72
- package/dist/proto/google/protobuf/wrappers.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/core/client.ts +31 -35
- package/src/core/ll_client.ts +48 -23
- package/src/proto/github.com/googleapis/googleapis/google/rpc/status.ts +72 -75
- package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.client.ts +21 -22
- package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.ts +276 -291
- package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.client.ts +54 -59
- package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.ts +470 -491
- package/src/proto/github.com/milaboratory/pl/plapi/plapiproto/api.client.ts +238 -263
- package/src/proto/github.com/milaboratory/pl/plapi/plapiproto/api.ts +11058 -11752
- package/src/proto/github.com/milaboratory/pl/plapi/plapiproto/api_types.ts +1115 -1156
- package/src/proto/github.com/milaboratory/pl/plapi/plapiproto/base_types.ts +126 -132
- package/src/proto/github.com/milaboratory/pl/plapi/plapiproto/import.ts +201 -204
- package/src/proto/github.com/milaboratory/pl/plapi/plapiproto/resource_types.ts +541 -560
- package/src/proto/google/protobuf/any.ts +140 -150
- package/src/proto/google/protobuf/duration.ts +103 -108
- package/src/proto/google/protobuf/empty.ts +39 -42
- package/src/proto/google/protobuf/struct.ts +323 -337
- package/src/proto/google/protobuf/timestamp.ts +124 -132
- package/src/proto/google/protobuf/wrappers.ts +492 -537
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by protobuf-ts 2.9.
|
|
1
|
+
// @generated by protobuf-ts 2.9.6 with parameter client_generic,optimize_speed,generate_dependencies,force_server_none
|
|
2
2
|
// @generated from protobuf file "google/protobuf/any.proto" (package "google.protobuf", syntax proto3)
|
|
3
3
|
// tslint:disable
|
|
4
4
|
//
|
|
@@ -32,22 +32,22 @@
|
|
|
32
32
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
33
33
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
34
34
|
//
|
|
35
|
-
import type { BinaryWriteOptions } from
|
|
36
|
-
import type { IBinaryWriter } from
|
|
37
|
-
import { WireType } from
|
|
38
|
-
import type { IBinaryReader } from
|
|
39
|
-
import { UnknownFieldHandler } from
|
|
40
|
-
import type { PartialMessage } from
|
|
41
|
-
import { reflectionMergePartial } from
|
|
42
|
-
import { isJsonObject } from
|
|
43
|
-
import { typeofJsonValue } from
|
|
44
|
-
import type { JsonValue } from
|
|
45
|
-
import { jsonWriteOptions } from
|
|
46
|
-
import type { JsonReadOptions } from
|
|
47
|
-
import type { JsonWriteOptions } from
|
|
48
|
-
import type { BinaryReadOptions } from
|
|
49
|
-
import type { IMessageType } from
|
|
50
|
-
import { MessageType } from
|
|
35
|
+
import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
|
|
36
|
+
import type { IBinaryWriter } from "@protobuf-ts/runtime";
|
|
37
|
+
import { WireType } from "@protobuf-ts/runtime";
|
|
38
|
+
import type { IBinaryReader } from "@protobuf-ts/runtime";
|
|
39
|
+
import { UnknownFieldHandler } from "@protobuf-ts/runtime";
|
|
40
|
+
import type { PartialMessage } from "@protobuf-ts/runtime";
|
|
41
|
+
import { reflectionMergePartial } from "@protobuf-ts/runtime";
|
|
42
|
+
import { isJsonObject } from "@protobuf-ts/runtime";
|
|
43
|
+
import { typeofJsonValue } from "@protobuf-ts/runtime";
|
|
44
|
+
import type { JsonValue } from "@protobuf-ts/runtime";
|
|
45
|
+
import { jsonWriteOptions } from "@protobuf-ts/runtime";
|
|
46
|
+
import type { JsonReadOptions } from "@protobuf-ts/runtime";
|
|
47
|
+
import type { JsonWriteOptions } from "@protobuf-ts/runtime";
|
|
48
|
+
import type { BinaryReadOptions } from "@protobuf-ts/runtime";
|
|
49
|
+
import type { IMessageType } from "@protobuf-ts/runtime";
|
|
50
|
+
import { MessageType } from "@protobuf-ts/runtime";
|
|
51
51
|
/**
|
|
52
52
|
* `Any` contains an arbitrary serialized protocol buffer message along with a
|
|
53
53
|
* URL that describes the type of the serialized message.
|
|
@@ -139,7 +139,7 @@ import { MessageType } from '@protobuf-ts/runtime';
|
|
|
139
139
|
* @generated from protobuf message google.protobuf.Any
|
|
140
140
|
*/
|
|
141
141
|
export interface Any {
|
|
142
|
-
|
|
142
|
+
/**
|
|
143
143
|
* A URL/resource name that uniquely identifies the type of the serialized
|
|
144
144
|
* protocol buffer message. This string must contain at least
|
|
145
145
|
* one "/" character. The last segment of the URL's path must represent
|
|
@@ -172,55 +172,51 @@ export interface Any {
|
|
|
172
172
|
*
|
|
173
173
|
* @generated from protobuf field: string type_url = 1;
|
|
174
174
|
*/
|
|
175
|
-
|
|
176
|
-
|
|
175
|
+
typeUrl: string;
|
|
176
|
+
/**
|
|
177
177
|
* Must be a valid serialized protocol buffer of the above specified type.
|
|
178
178
|
*
|
|
179
179
|
* @generated from protobuf field: bytes value = 2;
|
|
180
180
|
*/
|
|
181
|
-
|
|
181
|
+
value: Uint8Array;
|
|
182
182
|
}
|
|
183
183
|
// @generated message type with reflection information, may provide speed optimized methods
|
|
184
184
|
class Any$Type extends MessageType<Any> {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
/**
|
|
185
|
+
constructor() {
|
|
186
|
+
super("google.protobuf.Any", [
|
|
187
|
+
{ no: 1, name: "type_url", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
|
188
|
+
{ no: 2, name: "value", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }
|
|
189
|
+
]);
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
193
192
|
* Pack the message into a new `Any`.
|
|
194
193
|
*
|
|
195
194
|
* Uses 'type.googleapis.com/full.type.name' as the type URL.
|
|
196
195
|
*/
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
/**
|
|
196
|
+
pack<T extends object>(message: T, type: IMessageType<T>): Any {
|
|
197
|
+
return {
|
|
198
|
+
typeUrl: this.typeNameToUrl(type.typeName), value: type.toBinary(message),
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
204
202
|
* Unpack the message from the `Any`.
|
|
205
203
|
*/
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
/**
|
|
204
|
+
unpack<T extends object>(any: Any, type: IMessageType<T>, options?: Partial<BinaryReadOptions>): T {
|
|
205
|
+
if (!this.contains(any, type))
|
|
206
|
+
throw new Error("Cannot unpack google.protobuf.Any with typeUrl '" + any.typeUrl + "' as " + type.typeName + ".");
|
|
207
|
+
return type.fromBinary(any.value, options);
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
213
210
|
* Does the given `Any` contain a packed message of the given type?
|
|
214
211
|
*/
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
/**
|
|
212
|
+
contains(any: Any, type: IMessageType<any> | string): boolean {
|
|
213
|
+
if (!any.typeUrl.length)
|
|
214
|
+
return false;
|
|
215
|
+
let wants = typeof type == "string" ? type : type.typeName;
|
|
216
|
+
let has = this.typeUrlToName(any.typeUrl);
|
|
217
|
+
return wants === has;
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
224
220
|
* Convert the message to canonical JSON value.
|
|
225
221
|
*
|
|
226
222
|
* You have to provide the `typeRegistry` option so that the
|
|
@@ -229,106 +225,100 @@ class Any$Type extends MessageType<Any> {
|
|
|
229
225
|
* The `typeRegistry` option is also required to read
|
|
230
226
|
* `google.protobuf.Any` from JSON format.
|
|
231
227
|
*/
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
228
|
+
internalJsonWrite(any: Any, options: JsonWriteOptions): JsonValue {
|
|
229
|
+
if (any.typeUrl === "")
|
|
230
|
+
return {};
|
|
231
|
+
let typeName = this.typeUrlToName(any.typeUrl);
|
|
232
|
+
let opt = jsonWriteOptions(options);
|
|
233
|
+
let type = opt.typeRegistry?.find(t => t.typeName === typeName);
|
|
234
|
+
if (!type)
|
|
235
|
+
throw new globalThis.Error("Unable to convert google.protobuf.Any with typeUrl '" + any.typeUrl + "' to JSON. The specified type " + typeName + " is not available in the type registry.");
|
|
236
|
+
let value = type.fromBinary(any.value, { readUnknownField: false });
|
|
237
|
+
let json = type.internalJsonWrite(value, opt);
|
|
238
|
+
if (typeName.startsWith("google.protobuf.") || !isJsonObject(json))
|
|
239
|
+
json = { value: json };
|
|
240
|
+
json["@type"] = any.typeUrl;
|
|
241
|
+
return json;
|
|
242
|
+
}
|
|
243
|
+
internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: Any): Any {
|
|
244
|
+
if (!isJsonObject(json))
|
|
245
|
+
throw new globalThis.Error("Unable to parse google.protobuf.Any from JSON " + typeofJsonValue(json) + ".");
|
|
246
|
+
if (typeof json["@type"] != "string" || json["@type"] == "")
|
|
247
|
+
return this.create();
|
|
248
|
+
let typeName = this.typeUrlToName(json["@type"]);
|
|
249
|
+
let type = options?.typeRegistry?.find(t => t.typeName == typeName);
|
|
250
|
+
if (!type)
|
|
251
|
+
throw new globalThis.Error("Unable to parse google.protobuf.Any from JSON. The specified type " + typeName + " is not available in the type registry.");
|
|
252
|
+
let value;
|
|
253
|
+
if (typeName.startsWith("google.protobuf.") && json.hasOwnProperty("value"))
|
|
254
|
+
value = type.fromJson(json["value"], options);
|
|
255
|
+
else {
|
|
256
|
+
let copy = Object.assign({}, json);
|
|
257
|
+
delete copy["@type"];
|
|
258
|
+
value = type.fromJson(copy, options);
|
|
259
|
+
}
|
|
260
|
+
if (target === undefined)
|
|
261
|
+
target = this.create();
|
|
262
|
+
target.typeUrl = json["@type"];
|
|
263
|
+
target.value = type.toBinary(value);
|
|
264
|
+
return target;
|
|
265
|
+
}
|
|
266
|
+
typeNameToUrl(name: string): string {
|
|
267
|
+
if (!name.length)
|
|
268
|
+
throw new Error("invalid type name: " + name);
|
|
269
|
+
return "type.googleapis.com/" + name;
|
|
270
|
+
}
|
|
271
|
+
typeUrlToName(url: string): string {
|
|
272
|
+
if (!url.length)
|
|
273
|
+
throw new Error("invalid type url: " + url);
|
|
274
|
+
let slash = url.lastIndexOf("/");
|
|
275
|
+
let name = slash > 0 ? url.substring(slash + 1) : url;
|
|
276
|
+
if (!name.length)
|
|
277
|
+
throw new Error("invalid type url: " + url);
|
|
278
|
+
return name;
|
|
279
|
+
}
|
|
280
|
+
create(value?: PartialMessage<Any>): Any {
|
|
281
|
+
const message = globalThis.Object.create((this.messagePrototype!));
|
|
282
|
+
message.typeUrl = "";
|
|
283
|
+
message.value = new Uint8Array(0);
|
|
284
|
+
if (value !== undefined)
|
|
285
|
+
reflectionMergePartial<Any>(this, message, value);
|
|
286
|
+
return message;
|
|
287
|
+
}
|
|
288
|
+
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Any): Any {
|
|
289
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
290
|
+
while (reader.pos < end) {
|
|
291
|
+
let [fieldNo, wireType] = reader.tag();
|
|
292
|
+
switch (fieldNo) {
|
|
293
|
+
case /* string type_url */ 1:
|
|
294
|
+
message.typeUrl = reader.string();
|
|
295
|
+
break;
|
|
296
|
+
case /* bytes value */ 2:
|
|
297
|
+
message.value = reader.bytes();
|
|
298
|
+
break;
|
|
299
|
+
default:
|
|
300
|
+
let u = options.readUnknownField;
|
|
301
|
+
if (u === "throw")
|
|
302
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
303
|
+
let d = reader.skip(wireType);
|
|
304
|
+
if (u !== false)
|
|
305
|
+
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
return message;
|
|
264
309
|
}
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
typeUrlToName(url: string): string {
|
|
279
|
-
if (!url.length)
|
|
280
|
-
throw new Error('invalid type url: ' + url);
|
|
281
|
-
const slash = url.lastIndexOf('/');
|
|
282
|
-
const name = slash > 0 ? url.substring(slash + 1) : url;
|
|
283
|
-
if (!name.length)
|
|
284
|
-
throw new Error('invalid type url: ' + url);
|
|
285
|
-
return name;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
create(value?: PartialMessage<Any>): Any {
|
|
289
|
-
const message = globalThis.Object.create((this.messagePrototype!));
|
|
290
|
-
message.typeUrl = '';
|
|
291
|
-
message.value = new Uint8Array(0);
|
|
292
|
-
if (value !== undefined)
|
|
293
|
-
reflectionMergePartial<Any>(this, message, value);
|
|
294
|
-
return message;
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Any): Any {
|
|
298
|
-
const message = target ?? this.create(), end = reader.pos + length;
|
|
299
|
-
while (reader.pos < end) {
|
|
300
|
-
const [fieldNo, wireType] = reader.tag();
|
|
301
|
-
switch (fieldNo) {
|
|
302
|
-
case /* string type_url */ 1:
|
|
303
|
-
message.typeUrl = reader.string();
|
|
304
|
-
break;
|
|
305
|
-
case /* bytes value */ 2:
|
|
306
|
-
message.value = reader.bytes();
|
|
307
|
-
break;
|
|
308
|
-
default:
|
|
309
|
-
const u = options.readUnknownField;
|
|
310
|
-
if (u === 'throw')
|
|
311
|
-
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
312
|
-
const d = reader.skip(wireType);
|
|
313
|
-
if (u !== false)
|
|
314
|
-
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
315
|
-
}
|
|
310
|
+
internalBinaryWrite(message: Any, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
|
311
|
+
/* string type_url = 1; */
|
|
312
|
+
if (message.typeUrl !== "")
|
|
313
|
+
writer.tag(1, WireType.LengthDelimited).string(message.typeUrl);
|
|
314
|
+
/* bytes value = 2; */
|
|
315
|
+
if (message.value.length)
|
|
316
|
+
writer.tag(2, WireType.LengthDelimited).bytes(message.value);
|
|
317
|
+
let u = options.writeUnknownFields;
|
|
318
|
+
if (u !== false)
|
|
319
|
+
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
320
|
+
return writer;
|
|
316
321
|
}
|
|
317
|
-
return message;
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
internalBinaryWrite(message: Any, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
|
321
|
-
/* string type_url = 1; */
|
|
322
|
-
if (message.typeUrl !== '')
|
|
323
|
-
writer.tag(1, WireType.LengthDelimited).string(message.typeUrl);
|
|
324
|
-
/* bytes value = 2; */
|
|
325
|
-
if (message.value.length)
|
|
326
|
-
writer.tag(2, WireType.LengthDelimited).bytes(message.value);
|
|
327
|
-
const u = options.writeUnknownFields;
|
|
328
|
-
if (u !== false)
|
|
329
|
-
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
330
|
-
return writer;
|
|
331
|
-
}
|
|
332
322
|
}
|
|
333
323
|
/**
|
|
334
324
|
* @generated MessageType for protobuf message google.protobuf.Any
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by protobuf-ts 2.9.
|
|
1
|
+
// @generated by protobuf-ts 2.9.6 with parameter client_generic,optimize_speed,generate_dependencies,force_server_none
|
|
2
2
|
// @generated from protobuf file "google/protobuf/duration.proto" (package "google.protobuf", syntax proto3)
|
|
3
3
|
// tslint:disable
|
|
4
4
|
//
|
|
@@ -32,20 +32,20 @@
|
|
|
32
32
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
33
33
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
34
34
|
//
|
|
35
|
-
import type { BinaryWriteOptions } from
|
|
36
|
-
import type { IBinaryWriter } from
|
|
37
|
-
import { WireType } from
|
|
38
|
-
import type { BinaryReadOptions } from
|
|
39
|
-
import type { IBinaryReader } from
|
|
40
|
-
import { UnknownFieldHandler } from
|
|
41
|
-
import type { PartialMessage } from
|
|
42
|
-
import { reflectionMergePartial } from
|
|
43
|
-
import { typeofJsonValue } from
|
|
44
|
-
import type { JsonValue } from
|
|
45
|
-
import type { JsonReadOptions } from
|
|
46
|
-
import type { JsonWriteOptions } from
|
|
47
|
-
import { PbLong } from
|
|
48
|
-
import { MessageType } from
|
|
35
|
+
import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
|
|
36
|
+
import type { IBinaryWriter } from "@protobuf-ts/runtime";
|
|
37
|
+
import { WireType } from "@protobuf-ts/runtime";
|
|
38
|
+
import type { BinaryReadOptions } from "@protobuf-ts/runtime";
|
|
39
|
+
import type { IBinaryReader } from "@protobuf-ts/runtime";
|
|
40
|
+
import { UnknownFieldHandler } from "@protobuf-ts/runtime";
|
|
41
|
+
import type { PartialMessage } from "@protobuf-ts/runtime";
|
|
42
|
+
import { reflectionMergePartial } from "@protobuf-ts/runtime";
|
|
43
|
+
import { typeofJsonValue } from "@protobuf-ts/runtime";
|
|
44
|
+
import type { JsonValue } from "@protobuf-ts/runtime";
|
|
45
|
+
import type { JsonReadOptions } from "@protobuf-ts/runtime";
|
|
46
|
+
import type { JsonWriteOptions } from "@protobuf-ts/runtime";
|
|
47
|
+
import { PbLong } from "@protobuf-ts/runtime";
|
|
48
|
+
import { MessageType } from "@protobuf-ts/runtime";
|
|
49
49
|
/**
|
|
50
50
|
* A Duration represents a signed, fixed-length span of time represented
|
|
51
51
|
* as a count of seconds and fractions of seconds at nanosecond
|
|
@@ -110,15 +110,15 @@ import { MessageType } from '@protobuf-ts/runtime';
|
|
|
110
110
|
* @generated from protobuf message google.protobuf.Duration
|
|
111
111
|
*/
|
|
112
112
|
export interface Duration {
|
|
113
|
-
|
|
113
|
+
/**
|
|
114
114
|
* Signed seconds of the span of time. Must be from -315,576,000,000
|
|
115
115
|
* to +315,576,000,000 inclusive. Note: these bounds are computed from:
|
|
116
116
|
* 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
|
|
117
117
|
*
|
|
118
118
|
* @generated from protobuf field: int64 seconds = 1;
|
|
119
119
|
*/
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
seconds: bigint;
|
|
121
|
+
/**
|
|
122
122
|
* Signed fractions of a second at nanosecond resolution of the span
|
|
123
123
|
* of time. Durations less than one second are represented with a 0
|
|
124
124
|
* `seconds` field and a positive or negative `nanos` field. For durations
|
|
@@ -128,106 +128,101 @@ export interface Duration {
|
|
|
128
128
|
*
|
|
129
129
|
* @generated from protobuf field: int32 nanos = 2;
|
|
130
130
|
*/
|
|
131
|
-
|
|
131
|
+
nanos: number;
|
|
132
132
|
}
|
|
133
133
|
// @generated message type with reflection information, may provide speed optimized methods
|
|
134
134
|
class Duration$Type extends MessageType<Duration> {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
/**
|
|
135
|
+
constructor() {
|
|
136
|
+
super("google.protobuf.Duration", [
|
|
137
|
+
{ no: 1, name: "seconds", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
|
|
138
|
+
{ no: 2, name: "nanos", kind: "scalar", T: 5 /*ScalarType.INT32*/ }
|
|
139
|
+
]);
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
143
142
|
* Encode `Duration` to JSON string like "3.000001s".
|
|
144
143
|
*/
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
144
|
+
internalJsonWrite(message: Duration, options: JsonWriteOptions): JsonValue {
|
|
145
|
+
let s = PbLong.from(message.seconds).toNumber();
|
|
146
|
+
if (s > 315576000000 || s < -315576000000)
|
|
147
|
+
throw new Error("Duration value out of range.");
|
|
148
|
+
let text = message.seconds.toString();
|
|
149
|
+
if (s === 0 && message.nanos < 0)
|
|
150
|
+
text = "-" + text;
|
|
151
|
+
if (message.nanos !== 0) {
|
|
152
|
+
let nanosStr = Math.abs(message.nanos).toString();
|
|
153
|
+
nanosStr = "0".repeat(9 - nanosStr.length) + nanosStr;
|
|
154
|
+
if (nanosStr.substring(3) === "000000")
|
|
155
|
+
nanosStr = nanosStr.substring(0, 3);
|
|
156
|
+
else if (nanosStr.substring(6) === "000")
|
|
157
|
+
nanosStr = nanosStr.substring(0, 6);
|
|
158
|
+
text += "." + nanosStr;
|
|
159
|
+
}
|
|
160
|
+
return text + "s";
|
|
160
161
|
}
|
|
161
|
-
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
/**
|
|
162
|
+
/**
|
|
165
163
|
* Decode `Duration` from JSON string like "3.000001s"
|
|
166
164
|
*/
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
165
|
+
internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: Duration): Duration {
|
|
166
|
+
if (typeof json !== "string")
|
|
167
|
+
throw new Error("Unable to parse Duration from JSON " + typeofJsonValue(json) + ". Expected string.");
|
|
168
|
+
let match = json.match(/^(-?)([0-9]+)(?:\.([0-9]+))?s/);
|
|
169
|
+
if (match === null)
|
|
170
|
+
throw new Error("Unable to parse Duration from JSON string. Invalid format.");
|
|
171
|
+
if (!target)
|
|
172
|
+
target = this.create();
|
|
173
|
+
let [, sign, secs, nanos] = match;
|
|
174
|
+
let longSeconds = PbLong.from(sign + secs);
|
|
175
|
+
if (longSeconds.toNumber() > 315576000000 || longSeconds.toNumber() < -315576000000)
|
|
176
|
+
throw new Error("Unable to parse Duration from JSON string. Value out of range.");
|
|
177
|
+
target.seconds = longSeconds.toBigInt();
|
|
178
|
+
if (typeof nanos == "string") {
|
|
179
|
+
let nanosStr = sign + nanos + "0".repeat(9 - nanos.length);
|
|
180
|
+
target.nanos = parseInt(nanosStr);
|
|
181
|
+
}
|
|
182
|
+
return target;
|
|
183
|
+
}
|
|
184
|
+
create(value?: PartialMessage<Duration>): Duration {
|
|
185
|
+
const message = globalThis.Object.create((this.messagePrototype!));
|
|
186
|
+
message.seconds = 0n;
|
|
187
|
+
message.nanos = 0;
|
|
188
|
+
if (value !== undefined)
|
|
189
|
+
reflectionMergePartial<Duration>(this, message, value);
|
|
190
|
+
return message;
|
|
191
|
+
}
|
|
192
|
+
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Duration): Duration {
|
|
193
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
194
|
+
while (reader.pos < end) {
|
|
195
|
+
let [fieldNo, wireType] = reader.tag();
|
|
196
|
+
switch (fieldNo) {
|
|
197
|
+
case /* int64 seconds */ 1:
|
|
198
|
+
message.seconds = reader.int64().toBigInt();
|
|
199
|
+
break;
|
|
200
|
+
case /* int32 nanos */ 2:
|
|
201
|
+
message.nanos = reader.int32();
|
|
202
|
+
break;
|
|
203
|
+
default:
|
|
204
|
+
let u = options.readUnknownField;
|
|
205
|
+
if (u === "throw")
|
|
206
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
207
|
+
let d = reader.skip(wireType);
|
|
208
|
+
if (u !== false)
|
|
209
|
+
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
return message;
|
|
183
213
|
}
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Duration): Duration {
|
|
197
|
-
const message = target ?? this.create(), end = reader.pos + length;
|
|
198
|
-
while (reader.pos < end) {
|
|
199
|
-
const [fieldNo, wireType] = reader.tag();
|
|
200
|
-
switch (fieldNo) {
|
|
201
|
-
case /* int64 seconds */ 1:
|
|
202
|
-
message.seconds = reader.int64().toBigInt();
|
|
203
|
-
break;
|
|
204
|
-
case /* int32 nanos */ 2:
|
|
205
|
-
message.nanos = reader.int32();
|
|
206
|
-
break;
|
|
207
|
-
default:
|
|
208
|
-
const u = options.readUnknownField;
|
|
209
|
-
if (u === 'throw')
|
|
210
|
-
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
211
|
-
const d = reader.skip(wireType);
|
|
212
|
-
if (u !== false)
|
|
213
|
-
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
214
|
-
}
|
|
214
|
+
internalBinaryWrite(message: Duration, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
|
215
|
+
/* int64 seconds = 1; */
|
|
216
|
+
if (message.seconds !== 0n)
|
|
217
|
+
writer.tag(1, WireType.Varint).int64(message.seconds);
|
|
218
|
+
/* int32 nanos = 2; */
|
|
219
|
+
if (message.nanos !== 0)
|
|
220
|
+
writer.tag(2, WireType.Varint).int32(message.nanos);
|
|
221
|
+
let u = options.writeUnknownFields;
|
|
222
|
+
if (u !== false)
|
|
223
|
+
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
224
|
+
return writer;
|
|
215
225
|
}
|
|
216
|
-
return message;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
internalBinaryWrite(message: Duration, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
|
220
|
-
/* int64 seconds = 1; */
|
|
221
|
-
if (message.seconds !== 0n)
|
|
222
|
-
writer.tag(1, WireType.Varint).int64(message.seconds);
|
|
223
|
-
/* int32 nanos = 2; */
|
|
224
|
-
if (message.nanos !== 0)
|
|
225
|
-
writer.tag(2, WireType.Varint).int32(message.nanos);
|
|
226
|
-
const u = options.writeUnknownFields;
|
|
227
|
-
if (u !== false)
|
|
228
|
-
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
229
|
-
return writer;
|
|
230
|
-
}
|
|
231
226
|
}
|
|
232
227
|
/**
|
|
233
228
|
* @generated MessageType for protobuf message google.protobuf.Duration
|