@milaboratories/pl-client 2.4.10

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.
Files changed (64) hide show
  1. package/README.md +52 -0
  2. package/dist/index.cjs +14527 -0
  3. package/dist/index.cjs.map +1 -0
  4. package/dist/index.js +14426 -0
  5. package/dist/index.js.map +1 -0
  6. package/package.json +49 -0
  7. package/src/core/auth.ts +27 -0
  8. package/src/core/client.test.ts +47 -0
  9. package/src/core/client.ts +302 -0
  10. package/src/core/config.test.ts +19 -0
  11. package/src/core/config.ts +197 -0
  12. package/src/core/default_client.ts +161 -0
  13. package/src/core/driver.ts +30 -0
  14. package/src/core/error.test.ts +14 -0
  15. package/src/core/errors.ts +84 -0
  16. package/src/core/http.ts +178 -0
  17. package/src/core/ll_client.test.ts +111 -0
  18. package/src/core/ll_client.ts +228 -0
  19. package/src/core/ll_transaction.test.ts +152 -0
  20. package/src/core/ll_transaction.ts +333 -0
  21. package/src/core/transaction.test.ts +173 -0
  22. package/src/core/transaction.ts +730 -0
  23. package/src/core/type_conversion.ts +121 -0
  24. package/src/core/types.test.ts +22 -0
  25. package/src/core/types.ts +223 -0
  26. package/src/core/unauth_client.test.ts +21 -0
  27. package/src/core/unauth_client.ts +48 -0
  28. package/src/helpers/pl.ts +141 -0
  29. package/src/helpers/poll.ts +178 -0
  30. package/src/helpers/rich_resource_types.test.ts +22 -0
  31. package/src/helpers/rich_resource_types.ts +84 -0
  32. package/src/helpers/smart_accessors.ts +146 -0
  33. package/src/helpers/state_helpers.ts +5 -0
  34. package/src/helpers/tx_helpers.ts +24 -0
  35. package/src/index.ts +14 -0
  36. package/src/proto/github.com/googleapis/googleapis/google/rpc/status.ts +125 -0
  37. package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.client.ts +45 -0
  38. package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.ts +271 -0
  39. package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.client.ts +51 -0
  40. package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.ts +380 -0
  41. package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.client.ts +59 -0
  42. package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.ts +450 -0
  43. package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.client.ts +148 -0
  44. package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.ts +706 -0
  45. package/src/proto/github.com/milaboratory/pl/plapi/plapiproto/api.client.ts +406 -0
  46. package/src/proto/github.com/milaboratory/pl/plapi/plapiproto/api.ts +12636 -0
  47. package/src/proto/github.com/milaboratory/pl/plapi/plapiproto/api_types.ts +1384 -0
  48. package/src/proto/github.com/milaboratory/pl/plapi/plapiproto/base_types.ts +181 -0
  49. package/src/proto/github.com/milaboratory/pl/plapi/plapiproto/import.ts +251 -0
  50. package/src/proto/github.com/milaboratory/pl/plapi/plapiproto/resource_types.ts +693 -0
  51. package/src/proto/google/api/http.ts +687 -0
  52. package/src/proto/google/protobuf/any.ts +326 -0
  53. package/src/proto/google/protobuf/descriptor.ts +4502 -0
  54. package/src/proto/google/protobuf/duration.ts +230 -0
  55. package/src/proto/google/protobuf/empty.ts +81 -0
  56. package/src/proto/google/protobuf/struct.ts +482 -0
  57. package/src/proto/google/protobuf/timestamp.ts +287 -0
  58. package/src/proto/google/protobuf/wrappers.ts +751 -0
  59. package/src/test/test_config.test.ts +6 -0
  60. package/src/test/test_config.ts +166 -0
  61. package/src/util/branding.ts +4 -0
  62. package/src/util/pl.ts +11 -0
  63. package/src/util/util.test.ts +10 -0
  64. package/src/util/util.ts +9 -0
@@ -0,0 +1,751 @@
1
+ // @generated by protobuf-ts 2.9.4 with parameter client_generic,optimize_speed,generate_dependencies,force_server_none
2
+ // @generated from protobuf file "google/protobuf/wrappers.proto" (package "google.protobuf", syntax proto3)
3
+ // tslint:disable
4
+ //
5
+ // Protocol Buffers - Google's data interchange format
6
+ // Copyright 2008 Google Inc. All rights reserved.
7
+ // https://developers.google.com/protocol-buffers/
8
+ //
9
+ // Redistribution and use in source and binary forms, with or without
10
+ // modification, are permitted provided that the following conditions are
11
+ // met:
12
+ //
13
+ // * Redistributions of source code must retain the above copyright
14
+ // notice, this list of conditions and the following disclaimer.
15
+ // * Redistributions in binary form must reproduce the above
16
+ // copyright notice, this list of conditions and the following disclaimer
17
+ // in the documentation and/or other materials provided with the
18
+ // distribution.
19
+ // * Neither the name of Google Inc. nor the names of its
20
+ // contributors may be used to endorse or promote products derived from
21
+ // this software without specific prior written permission.
22
+ //
23
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24
+ // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25
+ // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26
+ // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27
+ // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28
+ // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29
+ // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30
+ // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31
+ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32
+ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33
+ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34
+ //
35
+ // Wrappers for primitive (non-message) types. These types are useful
36
+ // for embedding primitives in the `google.protobuf.Any` type and for places
37
+ // where we need to distinguish between the absence of a primitive
38
+ // typed field and its default value.
39
+ //
40
+ // These wrappers have no meaningful use within repeated fields as they lack
41
+ // the ability to detect presence on individual elements.
42
+ // These wrappers have no meaningful use within a map or a oneof since
43
+ // individual entries of a map or fields of a oneof can already detect presence.
44
+ //
45
+ import { ScalarType } from "@protobuf-ts/runtime";
46
+ import { LongType } from "@protobuf-ts/runtime";
47
+ import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
48
+ import type { IBinaryWriter } from "@protobuf-ts/runtime";
49
+ import { WireType } from "@protobuf-ts/runtime";
50
+ import type { BinaryReadOptions } from "@protobuf-ts/runtime";
51
+ import type { IBinaryReader } from "@protobuf-ts/runtime";
52
+ import { UnknownFieldHandler } from "@protobuf-ts/runtime";
53
+ import type { PartialMessage } from "@protobuf-ts/runtime";
54
+ import { reflectionMergePartial } from "@protobuf-ts/runtime";
55
+ import type { JsonValue } from "@protobuf-ts/runtime";
56
+ import type { JsonReadOptions } from "@protobuf-ts/runtime";
57
+ import type { JsonWriteOptions } from "@protobuf-ts/runtime";
58
+ import { MessageType } from "@protobuf-ts/runtime";
59
+ /**
60
+ * Wrapper message for `double`.
61
+ *
62
+ * The JSON representation for `DoubleValue` is JSON number.
63
+ *
64
+ * @generated from protobuf message google.protobuf.DoubleValue
65
+ */
66
+ export interface DoubleValue {
67
+ /**
68
+ * The double value.
69
+ *
70
+ * @generated from protobuf field: double value = 1;
71
+ */
72
+ value: number;
73
+ }
74
+ /**
75
+ * Wrapper message for `float`.
76
+ *
77
+ * The JSON representation for `FloatValue` is JSON number.
78
+ *
79
+ * @generated from protobuf message google.protobuf.FloatValue
80
+ */
81
+ export interface FloatValue {
82
+ /**
83
+ * The float value.
84
+ *
85
+ * @generated from protobuf field: float value = 1;
86
+ */
87
+ value: number;
88
+ }
89
+ /**
90
+ * Wrapper message for `int64`.
91
+ *
92
+ * The JSON representation for `Int64Value` is JSON string.
93
+ *
94
+ * @generated from protobuf message google.protobuf.Int64Value
95
+ */
96
+ export interface Int64Value {
97
+ /**
98
+ * The int64 value.
99
+ *
100
+ * @generated from protobuf field: int64 value = 1;
101
+ */
102
+ value: bigint;
103
+ }
104
+ /**
105
+ * Wrapper message for `uint64`.
106
+ *
107
+ * The JSON representation for `UInt64Value` is JSON string.
108
+ *
109
+ * @generated from protobuf message google.protobuf.UInt64Value
110
+ */
111
+ export interface UInt64Value {
112
+ /**
113
+ * The uint64 value.
114
+ *
115
+ * @generated from protobuf field: uint64 value = 1;
116
+ */
117
+ value: bigint;
118
+ }
119
+ /**
120
+ * Wrapper message for `int32`.
121
+ *
122
+ * The JSON representation for `Int32Value` is JSON number.
123
+ *
124
+ * @generated from protobuf message google.protobuf.Int32Value
125
+ */
126
+ export interface Int32Value {
127
+ /**
128
+ * The int32 value.
129
+ *
130
+ * @generated from protobuf field: int32 value = 1;
131
+ */
132
+ value: number;
133
+ }
134
+ /**
135
+ * Wrapper message for `uint32`.
136
+ *
137
+ * The JSON representation for `UInt32Value` is JSON number.
138
+ *
139
+ * @generated from protobuf message google.protobuf.UInt32Value
140
+ */
141
+ export interface UInt32Value {
142
+ /**
143
+ * The uint32 value.
144
+ *
145
+ * @generated from protobuf field: uint32 value = 1;
146
+ */
147
+ value: number;
148
+ }
149
+ /**
150
+ * Wrapper message for `bool`.
151
+ *
152
+ * The JSON representation for `BoolValue` is JSON `true` and `false`.
153
+ *
154
+ * @generated from protobuf message google.protobuf.BoolValue
155
+ */
156
+ export interface BoolValue {
157
+ /**
158
+ * The bool value.
159
+ *
160
+ * @generated from protobuf field: bool value = 1;
161
+ */
162
+ value: boolean;
163
+ }
164
+ /**
165
+ * Wrapper message for `string`.
166
+ *
167
+ * The JSON representation for `StringValue` is JSON string.
168
+ *
169
+ * @generated from protobuf message google.protobuf.StringValue
170
+ */
171
+ export interface StringValue {
172
+ /**
173
+ * The string value.
174
+ *
175
+ * @generated from protobuf field: string value = 1;
176
+ */
177
+ value: string;
178
+ }
179
+ /**
180
+ * Wrapper message for `bytes`.
181
+ *
182
+ * The JSON representation for `BytesValue` is JSON string.
183
+ *
184
+ * @generated from protobuf message google.protobuf.BytesValue
185
+ */
186
+ export interface BytesValue {
187
+ /**
188
+ * The bytes value.
189
+ *
190
+ * @generated from protobuf field: bytes value = 1;
191
+ */
192
+ value: Uint8Array;
193
+ }
194
+ // @generated message type with reflection information, may provide speed optimized methods
195
+ class DoubleValue$Type extends MessageType<DoubleValue> {
196
+ constructor() {
197
+ super("google.protobuf.DoubleValue", [
198
+ { no: 1, name: "value", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ }
199
+ ]);
200
+ }
201
+ /**
202
+ * Encode `DoubleValue` to JSON number.
203
+ */
204
+ internalJsonWrite(message: DoubleValue, options: JsonWriteOptions): JsonValue {
205
+ return this.refJsonWriter.scalar(2, message.value, "value", false, true);
206
+ }
207
+ /**
208
+ * Decode `DoubleValue` from JSON number.
209
+ */
210
+ internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: DoubleValue): DoubleValue {
211
+ if (!target)
212
+ target = this.create();
213
+ target.value = this.refJsonReader.scalar(json, 1, undefined, "value") as number;
214
+ return target;
215
+ }
216
+ create(value?: PartialMessage<DoubleValue>): DoubleValue {
217
+ const message = globalThis.Object.create((this.messagePrototype!));
218
+ message.value = 0;
219
+ if (value !== undefined)
220
+ reflectionMergePartial<DoubleValue>(this, message, value);
221
+ return message;
222
+ }
223
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DoubleValue): DoubleValue {
224
+ let message = target ?? this.create(), end = reader.pos + length;
225
+ while (reader.pos < end) {
226
+ let [fieldNo, wireType] = reader.tag();
227
+ switch (fieldNo) {
228
+ case /* double value */ 1:
229
+ message.value = reader.double();
230
+ break;
231
+ default:
232
+ let u = options.readUnknownField;
233
+ if (u === "throw")
234
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
235
+ let d = reader.skip(wireType);
236
+ if (u !== false)
237
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
238
+ }
239
+ }
240
+ return message;
241
+ }
242
+ internalBinaryWrite(message: DoubleValue, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
243
+ /* double value = 1; */
244
+ if (message.value !== 0)
245
+ writer.tag(1, WireType.Bit64).double(message.value);
246
+ let u = options.writeUnknownFields;
247
+ if (u !== false)
248
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
249
+ return writer;
250
+ }
251
+ }
252
+ /**
253
+ * @generated MessageType for protobuf message google.protobuf.DoubleValue
254
+ */
255
+ export const DoubleValue = new DoubleValue$Type();
256
+ // @generated message type with reflection information, may provide speed optimized methods
257
+ class FloatValue$Type extends MessageType<FloatValue> {
258
+ constructor() {
259
+ super("google.protobuf.FloatValue", [
260
+ { no: 1, name: "value", kind: "scalar", T: 2 /*ScalarType.FLOAT*/ }
261
+ ]);
262
+ }
263
+ /**
264
+ * Encode `FloatValue` to JSON number.
265
+ */
266
+ internalJsonWrite(message: FloatValue, options: JsonWriteOptions): JsonValue {
267
+ return this.refJsonWriter.scalar(1, message.value, "value", false, true);
268
+ }
269
+ /**
270
+ * Decode `FloatValue` from JSON number.
271
+ */
272
+ internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: FloatValue): FloatValue {
273
+ if (!target)
274
+ target = this.create();
275
+ target.value = this.refJsonReader.scalar(json, 1, undefined, "value") as number;
276
+ return target;
277
+ }
278
+ create(value?: PartialMessage<FloatValue>): FloatValue {
279
+ const message = globalThis.Object.create((this.messagePrototype!));
280
+ message.value = 0;
281
+ if (value !== undefined)
282
+ reflectionMergePartial<FloatValue>(this, message, value);
283
+ return message;
284
+ }
285
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FloatValue): FloatValue {
286
+ let message = target ?? this.create(), end = reader.pos + length;
287
+ while (reader.pos < end) {
288
+ let [fieldNo, wireType] = reader.tag();
289
+ switch (fieldNo) {
290
+ case /* float value */ 1:
291
+ message.value = reader.float();
292
+ break;
293
+ default:
294
+ let u = options.readUnknownField;
295
+ if (u === "throw")
296
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
297
+ let d = reader.skip(wireType);
298
+ if (u !== false)
299
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
300
+ }
301
+ }
302
+ return message;
303
+ }
304
+ internalBinaryWrite(message: FloatValue, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
305
+ /* float value = 1; */
306
+ if (message.value !== 0)
307
+ writer.tag(1, WireType.Bit32).float(message.value);
308
+ let u = options.writeUnknownFields;
309
+ if (u !== false)
310
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
311
+ return writer;
312
+ }
313
+ }
314
+ /**
315
+ * @generated MessageType for protobuf message google.protobuf.FloatValue
316
+ */
317
+ export const FloatValue = new FloatValue$Type();
318
+ // @generated message type with reflection information, may provide speed optimized methods
319
+ class Int64Value$Type extends MessageType<Int64Value> {
320
+ constructor() {
321
+ super("google.protobuf.Int64Value", [
322
+ { no: 1, name: "value", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }
323
+ ]);
324
+ }
325
+ /**
326
+ * Encode `Int64Value` to JSON string.
327
+ */
328
+ internalJsonWrite(message: Int64Value, options: JsonWriteOptions): JsonValue {
329
+ return this.refJsonWriter.scalar(ScalarType.INT64, message.value, "value", false, true);
330
+ }
331
+ /**
332
+ * Decode `Int64Value` from JSON string.
333
+ */
334
+ internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: Int64Value): Int64Value {
335
+ if (!target)
336
+ target = this.create();
337
+ target.value = this.refJsonReader.scalar(json, ScalarType.INT64, LongType.BIGINT, "value") as any;
338
+ return target;
339
+ }
340
+ create(value?: PartialMessage<Int64Value>): Int64Value {
341
+ const message = globalThis.Object.create((this.messagePrototype!));
342
+ message.value = 0n;
343
+ if (value !== undefined)
344
+ reflectionMergePartial<Int64Value>(this, message, value);
345
+ return message;
346
+ }
347
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Int64Value): Int64Value {
348
+ let message = target ?? this.create(), end = reader.pos + length;
349
+ while (reader.pos < end) {
350
+ let [fieldNo, wireType] = reader.tag();
351
+ switch (fieldNo) {
352
+ case /* int64 value */ 1:
353
+ message.value = reader.int64().toBigInt();
354
+ break;
355
+ default:
356
+ let u = options.readUnknownField;
357
+ if (u === "throw")
358
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
359
+ let d = reader.skip(wireType);
360
+ if (u !== false)
361
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
362
+ }
363
+ }
364
+ return message;
365
+ }
366
+ internalBinaryWrite(message: Int64Value, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
367
+ /* int64 value = 1; */
368
+ if (message.value !== 0n)
369
+ writer.tag(1, WireType.Varint).int64(message.value);
370
+ let u = options.writeUnknownFields;
371
+ if (u !== false)
372
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
373
+ return writer;
374
+ }
375
+ }
376
+ /**
377
+ * @generated MessageType for protobuf message google.protobuf.Int64Value
378
+ */
379
+ export const Int64Value = new Int64Value$Type();
380
+ // @generated message type with reflection information, may provide speed optimized methods
381
+ class UInt64Value$Type extends MessageType<UInt64Value> {
382
+ constructor() {
383
+ super("google.protobuf.UInt64Value", [
384
+ { no: 1, name: "value", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }
385
+ ]);
386
+ }
387
+ /**
388
+ * Encode `UInt64Value` to JSON string.
389
+ */
390
+ internalJsonWrite(message: UInt64Value, options: JsonWriteOptions): JsonValue {
391
+ return this.refJsonWriter.scalar(ScalarType.UINT64, message.value, "value", false, true);
392
+ }
393
+ /**
394
+ * Decode `UInt64Value` from JSON string.
395
+ */
396
+ internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: UInt64Value): UInt64Value {
397
+ if (!target)
398
+ target = this.create();
399
+ target.value = this.refJsonReader.scalar(json, ScalarType.UINT64, LongType.BIGINT, "value") as any;
400
+ return target;
401
+ }
402
+ create(value?: PartialMessage<UInt64Value>): UInt64Value {
403
+ const message = globalThis.Object.create((this.messagePrototype!));
404
+ message.value = 0n;
405
+ if (value !== undefined)
406
+ reflectionMergePartial<UInt64Value>(this, message, value);
407
+ return message;
408
+ }
409
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UInt64Value): UInt64Value {
410
+ let message = target ?? this.create(), end = reader.pos + length;
411
+ while (reader.pos < end) {
412
+ let [fieldNo, wireType] = reader.tag();
413
+ switch (fieldNo) {
414
+ case /* uint64 value */ 1:
415
+ message.value = reader.uint64().toBigInt();
416
+ break;
417
+ default:
418
+ let u = options.readUnknownField;
419
+ if (u === "throw")
420
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
421
+ let d = reader.skip(wireType);
422
+ if (u !== false)
423
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
424
+ }
425
+ }
426
+ return message;
427
+ }
428
+ internalBinaryWrite(message: UInt64Value, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
429
+ /* uint64 value = 1; */
430
+ if (message.value !== 0n)
431
+ writer.tag(1, WireType.Varint).uint64(message.value);
432
+ let u = options.writeUnknownFields;
433
+ if (u !== false)
434
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
435
+ return writer;
436
+ }
437
+ }
438
+ /**
439
+ * @generated MessageType for protobuf message google.protobuf.UInt64Value
440
+ */
441
+ export const UInt64Value = new UInt64Value$Type();
442
+ // @generated message type with reflection information, may provide speed optimized methods
443
+ class Int32Value$Type extends MessageType<Int32Value> {
444
+ constructor() {
445
+ super("google.protobuf.Int32Value", [
446
+ { no: 1, name: "value", kind: "scalar", T: 5 /*ScalarType.INT32*/ }
447
+ ]);
448
+ }
449
+ /**
450
+ * Encode `Int32Value` to JSON string.
451
+ */
452
+ internalJsonWrite(message: Int32Value, options: JsonWriteOptions): JsonValue {
453
+ return this.refJsonWriter.scalar(5, message.value, "value", false, true);
454
+ }
455
+ /**
456
+ * Decode `Int32Value` from JSON string.
457
+ */
458
+ internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: Int32Value): Int32Value {
459
+ if (!target)
460
+ target = this.create();
461
+ target.value = this.refJsonReader.scalar(json, 5, undefined, "value") as number;
462
+ return target;
463
+ }
464
+ create(value?: PartialMessage<Int32Value>): Int32Value {
465
+ const message = globalThis.Object.create((this.messagePrototype!));
466
+ message.value = 0;
467
+ if (value !== undefined)
468
+ reflectionMergePartial<Int32Value>(this, message, value);
469
+ return message;
470
+ }
471
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Int32Value): Int32Value {
472
+ let message = target ?? this.create(), end = reader.pos + length;
473
+ while (reader.pos < end) {
474
+ let [fieldNo, wireType] = reader.tag();
475
+ switch (fieldNo) {
476
+ case /* int32 value */ 1:
477
+ message.value = reader.int32();
478
+ break;
479
+ default:
480
+ let u = options.readUnknownField;
481
+ if (u === "throw")
482
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
483
+ let d = reader.skip(wireType);
484
+ if (u !== false)
485
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
486
+ }
487
+ }
488
+ return message;
489
+ }
490
+ internalBinaryWrite(message: Int32Value, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
491
+ /* int32 value = 1; */
492
+ if (message.value !== 0)
493
+ writer.tag(1, WireType.Varint).int32(message.value);
494
+ let u = options.writeUnknownFields;
495
+ if (u !== false)
496
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
497
+ return writer;
498
+ }
499
+ }
500
+ /**
501
+ * @generated MessageType for protobuf message google.protobuf.Int32Value
502
+ */
503
+ export const Int32Value = new Int32Value$Type();
504
+ // @generated message type with reflection information, may provide speed optimized methods
505
+ class UInt32Value$Type extends MessageType<UInt32Value> {
506
+ constructor() {
507
+ super("google.protobuf.UInt32Value", [
508
+ { no: 1, name: "value", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }
509
+ ]);
510
+ }
511
+ /**
512
+ * Encode `UInt32Value` to JSON string.
513
+ */
514
+ internalJsonWrite(message: UInt32Value, options: JsonWriteOptions): JsonValue {
515
+ return this.refJsonWriter.scalar(13, message.value, "value", false, true);
516
+ }
517
+ /**
518
+ * Decode `UInt32Value` from JSON string.
519
+ */
520
+ internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: UInt32Value): UInt32Value {
521
+ if (!target)
522
+ target = this.create();
523
+ target.value = this.refJsonReader.scalar(json, 13, undefined, "value") as number;
524
+ return target;
525
+ }
526
+ create(value?: PartialMessage<UInt32Value>): UInt32Value {
527
+ const message = globalThis.Object.create((this.messagePrototype!));
528
+ message.value = 0;
529
+ if (value !== undefined)
530
+ reflectionMergePartial<UInt32Value>(this, message, value);
531
+ return message;
532
+ }
533
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UInt32Value): UInt32Value {
534
+ let message = target ?? this.create(), end = reader.pos + length;
535
+ while (reader.pos < end) {
536
+ let [fieldNo, wireType] = reader.tag();
537
+ switch (fieldNo) {
538
+ case /* uint32 value */ 1:
539
+ message.value = reader.uint32();
540
+ break;
541
+ default:
542
+ let u = options.readUnknownField;
543
+ if (u === "throw")
544
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
545
+ let d = reader.skip(wireType);
546
+ if (u !== false)
547
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
548
+ }
549
+ }
550
+ return message;
551
+ }
552
+ internalBinaryWrite(message: UInt32Value, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
553
+ /* uint32 value = 1; */
554
+ if (message.value !== 0)
555
+ writer.tag(1, WireType.Varint).uint32(message.value);
556
+ let u = options.writeUnknownFields;
557
+ if (u !== false)
558
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
559
+ return writer;
560
+ }
561
+ }
562
+ /**
563
+ * @generated MessageType for protobuf message google.protobuf.UInt32Value
564
+ */
565
+ export const UInt32Value = new UInt32Value$Type();
566
+ // @generated message type with reflection information, may provide speed optimized methods
567
+ class BoolValue$Type extends MessageType<BoolValue> {
568
+ constructor() {
569
+ super("google.protobuf.BoolValue", [
570
+ { no: 1, name: "value", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
571
+ ]);
572
+ }
573
+ /**
574
+ * Encode `BoolValue` to JSON bool.
575
+ */
576
+ internalJsonWrite(message: BoolValue, options: JsonWriteOptions): JsonValue {
577
+ return message.value;
578
+ }
579
+ /**
580
+ * Decode `BoolValue` from JSON bool.
581
+ */
582
+ internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: BoolValue): BoolValue {
583
+ if (!target)
584
+ target = this.create();
585
+ target.value = this.refJsonReader.scalar(json, 8, undefined, "value") as boolean;
586
+ return target;
587
+ }
588
+ create(value?: PartialMessage<BoolValue>): BoolValue {
589
+ const message = globalThis.Object.create((this.messagePrototype!));
590
+ message.value = false;
591
+ if (value !== undefined)
592
+ reflectionMergePartial<BoolValue>(this, message, value);
593
+ return message;
594
+ }
595
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: BoolValue): BoolValue {
596
+ let message = target ?? this.create(), end = reader.pos + length;
597
+ while (reader.pos < end) {
598
+ let [fieldNo, wireType] = reader.tag();
599
+ switch (fieldNo) {
600
+ case /* bool value */ 1:
601
+ message.value = reader.bool();
602
+ break;
603
+ default:
604
+ let u = options.readUnknownField;
605
+ if (u === "throw")
606
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
607
+ let d = reader.skip(wireType);
608
+ if (u !== false)
609
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
610
+ }
611
+ }
612
+ return message;
613
+ }
614
+ internalBinaryWrite(message: BoolValue, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
615
+ /* bool value = 1; */
616
+ if (message.value !== false)
617
+ writer.tag(1, WireType.Varint).bool(message.value);
618
+ let u = options.writeUnknownFields;
619
+ if (u !== false)
620
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
621
+ return writer;
622
+ }
623
+ }
624
+ /**
625
+ * @generated MessageType for protobuf message google.protobuf.BoolValue
626
+ */
627
+ export const BoolValue = new BoolValue$Type();
628
+ // @generated message type with reflection information, may provide speed optimized methods
629
+ class StringValue$Type extends MessageType<StringValue> {
630
+ constructor() {
631
+ super("google.protobuf.StringValue", [
632
+ { no: 1, name: "value", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
633
+ ]);
634
+ }
635
+ /**
636
+ * Encode `StringValue` to JSON string.
637
+ */
638
+ internalJsonWrite(message: StringValue, options: JsonWriteOptions): JsonValue {
639
+ return message.value;
640
+ }
641
+ /**
642
+ * Decode `StringValue` from JSON string.
643
+ */
644
+ internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: StringValue): StringValue {
645
+ if (!target)
646
+ target = this.create();
647
+ target.value = this.refJsonReader.scalar(json, 9, undefined, "value") as string;
648
+ return target;
649
+ }
650
+ create(value?: PartialMessage<StringValue>): StringValue {
651
+ const message = globalThis.Object.create((this.messagePrototype!));
652
+ message.value = "";
653
+ if (value !== undefined)
654
+ reflectionMergePartial<StringValue>(this, message, value);
655
+ return message;
656
+ }
657
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: StringValue): StringValue {
658
+ let message = target ?? this.create(), end = reader.pos + length;
659
+ while (reader.pos < end) {
660
+ let [fieldNo, wireType] = reader.tag();
661
+ switch (fieldNo) {
662
+ case /* string value */ 1:
663
+ message.value = reader.string();
664
+ break;
665
+ default:
666
+ let u = options.readUnknownField;
667
+ if (u === "throw")
668
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
669
+ let d = reader.skip(wireType);
670
+ if (u !== false)
671
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
672
+ }
673
+ }
674
+ return message;
675
+ }
676
+ internalBinaryWrite(message: StringValue, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
677
+ /* string value = 1; */
678
+ if (message.value !== "")
679
+ writer.tag(1, WireType.LengthDelimited).string(message.value);
680
+ let u = options.writeUnknownFields;
681
+ if (u !== false)
682
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
683
+ return writer;
684
+ }
685
+ }
686
+ /**
687
+ * @generated MessageType for protobuf message google.protobuf.StringValue
688
+ */
689
+ export const StringValue = new StringValue$Type();
690
+ // @generated message type with reflection information, may provide speed optimized methods
691
+ class BytesValue$Type extends MessageType<BytesValue> {
692
+ constructor() {
693
+ super("google.protobuf.BytesValue", [
694
+ { no: 1, name: "value", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }
695
+ ]);
696
+ }
697
+ /**
698
+ * Encode `BytesValue` to JSON string.
699
+ */
700
+ internalJsonWrite(message: BytesValue, options: JsonWriteOptions): JsonValue {
701
+ return this.refJsonWriter.scalar(12, message.value, "value", false, true);
702
+ }
703
+ /**
704
+ * Decode `BytesValue` from JSON string.
705
+ */
706
+ internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: BytesValue): BytesValue {
707
+ if (!target)
708
+ target = this.create();
709
+ target.value = this.refJsonReader.scalar(json, 12, undefined, "value") as Uint8Array;
710
+ return target;
711
+ }
712
+ create(value?: PartialMessage<BytesValue>): BytesValue {
713
+ const message = globalThis.Object.create((this.messagePrototype!));
714
+ message.value = new Uint8Array(0);
715
+ if (value !== undefined)
716
+ reflectionMergePartial<BytesValue>(this, message, value);
717
+ return message;
718
+ }
719
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: BytesValue): BytesValue {
720
+ let message = target ?? this.create(), end = reader.pos + length;
721
+ while (reader.pos < end) {
722
+ let [fieldNo, wireType] = reader.tag();
723
+ switch (fieldNo) {
724
+ case /* bytes value */ 1:
725
+ message.value = reader.bytes();
726
+ break;
727
+ default:
728
+ let u = options.readUnknownField;
729
+ if (u === "throw")
730
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
731
+ let d = reader.skip(wireType);
732
+ if (u !== false)
733
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
734
+ }
735
+ }
736
+ return message;
737
+ }
738
+ internalBinaryWrite(message: BytesValue, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
739
+ /* bytes value = 1; */
740
+ if (message.value.length)
741
+ writer.tag(1, WireType.LengthDelimited).bytes(message.value);
742
+ let u = options.writeUnknownFields;
743
+ if (u !== false)
744
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
745
+ return writer;
746
+ }
747
+ }
748
+ /**
749
+ * @generated MessageType for protobuf message google.protobuf.BytesValue
750
+ */
751
+ export const BytesValue = new BytesValue$Type();