@milaboratories/pl-client 2.7.13 → 2.7.14

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 (116) hide show
  1. package/dist/core/auth.d.ts.map +1 -1
  2. package/dist/core/cache.d.ts.map +1 -1
  3. package/dist/core/client.d.ts +1 -1
  4. package/dist/core/client.d.ts.map +1 -1
  5. package/dist/core/default_client.d.ts.map +1 -1
  6. package/dist/core/driver.d.ts.map +1 -1
  7. package/dist/core/errors.d.ts.map +1 -1
  8. package/dist/core/final.d.ts.map +1 -1
  9. package/dist/core/ll_client.d.ts.map +1 -1
  10. package/dist/core/ll_transaction.d.ts.map +1 -1
  11. package/dist/core/transaction.d.ts +1 -1
  12. package/dist/core/transaction.d.ts.map +1 -1
  13. package/dist/core/type_conversion.d.ts.map +1 -1
  14. package/dist/core/types.d.ts +1 -1
  15. package/dist/core/types.d.ts.map +1 -1
  16. package/dist/core/unauth_client.d.ts.map +1 -1
  17. package/dist/helpers/pl.d.ts.map +1 -1
  18. package/dist/helpers/poll.d.ts.map +1 -1
  19. package/dist/helpers/state_helpers.d.ts.map +1 -1
  20. package/dist/helpers/tx_helpers.d.ts.map +1 -1
  21. package/dist/index.js +1 -1
  22. package/dist/index.js.map +1 -1
  23. package/dist/index.mjs +4069 -4075
  24. package/dist/index.mjs.map +1 -1
  25. package/dist/proto/github.com/googleapis/googleapis/google/rpc/status.d.ts +15 -15
  26. package/dist/proto/github.com/googleapis/googleapis/google/rpc/status.d.ts.map +1 -1
  27. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.client.d.ts +4 -4
  28. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.client.d.ts.map +1 -1
  29. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.d.ts +16 -16
  30. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.d.ts.map +1 -1
  31. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.client.d.ts +4 -4
  32. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.client.d.ts.map +1 -1
  33. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.d.ts +59 -59
  34. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.d.ts.map +1 -1
  35. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.client.d.ts +8 -8
  36. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.client.d.ts.map +1 -1
  37. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.d.ts +22 -22
  38. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.d.ts.map +1 -1
  39. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.client.d.ts +72 -72
  40. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.client.d.ts.map +1 -1
  41. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.d.ts +152 -152
  42. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.d.ts.map +1 -1
  43. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api.client.d.ts +156 -156
  44. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api.client.d.ts.map +1 -1
  45. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api.d.ts +773 -773
  46. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api.d.ts.map +1 -1
  47. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api_types.d.ts +163 -163
  48. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api_types.d.ts.map +1 -1
  49. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/base_types.d.ts +22 -22
  50. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/base_types.d.ts.map +1 -1
  51. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/import.d.ts +32 -32
  52. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/import.d.ts.map +1 -1
  53. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/resource_types.d.ts +78 -78
  54. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/resource_types.d.ts.map +1 -1
  55. package/dist/proto/google/api/http.d.ts +89 -89
  56. package/dist/proto/google/api/http.d.ts.map +1 -1
  57. package/dist/proto/google/protobuf/any.d.ts +52 -52
  58. package/dist/proto/google/protobuf/any.d.ts.map +1 -1
  59. package/dist/proto/google/protobuf/descriptor.d.ts +1151 -1151
  60. package/dist/proto/google/protobuf/descriptor.d.ts.map +1 -1
  61. package/dist/proto/google/protobuf/duration.d.ts +19 -19
  62. package/dist/proto/google/protobuf/duration.d.ts.map +1 -1
  63. package/dist/proto/google/protobuf/empty.d.ts.map +1 -1
  64. package/dist/proto/google/protobuf/struct.d.ts +56 -56
  65. package/dist/proto/google/protobuf/struct.d.ts.map +1 -1
  66. package/dist/proto/google/protobuf/timestamp.d.ts +25 -25
  67. package/dist/proto/google/protobuf/timestamp.d.ts.map +1 -1
  68. package/dist/proto/google/protobuf/wrappers.d.ts +72 -72
  69. package/dist/proto/google/protobuf/wrappers.d.ts.map +1 -1
  70. package/dist/test/test_config.d.ts.map +1 -1
  71. package/dist/util/util.d.ts.map +1 -1
  72. package/package.json +7 -3
  73. package/src/core/auth.ts +3 -3
  74. package/src/core/cache.ts +1 -1
  75. package/src/core/client.ts +39 -31
  76. package/src/core/config.ts +21 -21
  77. package/src/core/default_client.ts +15 -14
  78. package/src/core/driver.ts +4 -4
  79. package/src/core/errors.ts +3 -3
  80. package/src/core/final.ts +7 -4
  81. package/src/core/ll_client.ts +31 -27
  82. package/src/core/ll_transaction.ts +17 -17
  83. package/src/core/stat.ts +2 -2
  84. package/src/core/transaction.ts +93 -95
  85. package/src/core/type_conversion.ts +11 -8
  86. package/src/core/types.ts +25 -26
  87. package/src/core/unauth_client.ts +6 -6
  88. package/src/helpers/pl.ts +8 -7
  89. package/src/helpers/poll.ts +25 -21
  90. package/src/helpers/state_helpers.ts +2 -1
  91. package/src/helpers/tx_helpers.ts +4 -3
  92. package/src/proto/github.com/googleapis/googleapis/google/rpc/status.ts +74 -71
  93. package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.client.ts +21 -20
  94. package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.ts +240 -225
  95. package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.client.ts +21 -20
  96. package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.ts +290 -275
  97. package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.client.ts +32 -30
  98. package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.ts +388 -364
  99. package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.client.ts +58 -53
  100. package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.ts +490 -469
  101. package/src/proto/github.com/milaboratory/pl/plapi/plapiproto/api.client.ts +262 -237
  102. package/src/proto/github.com/milaboratory/pl/plapi/plapiproto/api.ts +11751 -11032
  103. package/src/proto/github.com/milaboratory/pl/plapi/plapiproto/api_types.ts +1155 -1114
  104. package/src/proto/github.com/milaboratory/pl/plapi/plapiproto/base_types.ts +131 -125
  105. package/src/proto/github.com/milaboratory/pl/plapi/plapiproto/import.ts +203 -200
  106. package/src/proto/github.com/milaboratory/pl/plapi/plapiproto/resource_types.ts +559 -540
  107. package/src/proto/google/api/http.ts +280 -271
  108. package/src/proto/google/protobuf/any.ts +149 -139
  109. package/src/proto/google/protobuf/descriptor.ts +2952 -2853
  110. package/src/proto/google/protobuf/duration.ts +107 -102
  111. package/src/proto/google/protobuf/empty.ts +41 -38
  112. package/src/proto/google/protobuf/struct.ts +336 -322
  113. package/src/proto/google/protobuf/timestamp.ts +131 -123
  114. package/src/proto/google/protobuf/wrappers.ts +536 -491
  115. package/src/test/test_config.ts +21 -19
  116. package/src/util/util.ts +1 -0
@@ -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 "@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";
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,51 +172,55 @@ export interface Any {
172
172
  *
173
173
  * @generated from protobuf field: string type_url = 1;
174
174
  */
175
- typeUrl: string;
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
- value: Uint8Array;
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
- 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
- /**
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
+
192
+ /**
192
193
  * Pack the message into a new `Any`.
193
194
  *
194
195
  * Uses 'type.googleapis.com/full.type.name' as the type URL.
195
196
  */
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
- /**
197
+ pack<T extends object>(message: T, type: IMessageType<T>): Any {
198
+ return {
199
+ typeUrl: this.typeNameToUrl(type.typeName), value: type.toBinary(message),
200
+ };
201
+ }
202
+
203
+ /**
202
204
  * Unpack the message from the `Any`.
203
205
  */
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
- /**
206
+ unpack<T extends object>(any: Any, type: IMessageType<T>, options?: Partial<BinaryReadOptions>): T {
207
+ if (!this.contains(any, type))
208
+ throw new Error('Cannot unpack google.protobuf.Any with typeUrl \'' + any.typeUrl + '\' as ' + type.typeName + '.');
209
+ return type.fromBinary(any.value, options);
210
+ }
211
+
212
+ /**
210
213
  * Does the given `Any` contain a packed message of the given type?
211
214
  */
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
- /**
215
+ contains(any: Any, type: IMessageType<any> | string): boolean {
216
+ if (!any.typeUrl.length)
217
+ return false;
218
+ const wants = typeof type == 'string' ? type : type.typeName;
219
+ const has = this.typeUrlToName(any.typeUrl);
220
+ return wants === has;
221
+ }
222
+
223
+ /**
220
224
  * Convert the message to canonical JSON value.
221
225
  *
222
226
  * You have to provide the `typeRegistry` option so that the
@@ -225,100 +229,106 @@ class Any$Type extends MessageType<Any> {
225
229
  * The `typeRegistry` option is also required to read
226
230
  * `google.protobuf.Any` from JSON format.
227
231
  */
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;
232
+ internalJsonWrite(any: Any, options: JsonWriteOptions): JsonValue {
233
+ if (any.typeUrl === '')
234
+ return {};
235
+ const typeName = this.typeUrlToName(any.typeUrl);
236
+ const opt = jsonWriteOptions(options);
237
+ const type = opt.typeRegistry?.find((t) => t.typeName === typeName);
238
+ if (!type)
239
+ 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.');
240
+ const value = type.fromBinary(any.value, { readUnknownField: false });
241
+ let json = type.internalJsonWrite(value, opt);
242
+ if (typeName.startsWith('google.protobuf.') || !isJsonObject(json))
243
+ json = { value: json };
244
+ json['@type'] = any.typeUrl;
245
+ return json;
246
+ }
247
+
248
+ internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: Any): Any {
249
+ if (!isJsonObject(json))
250
+ throw new globalThis.Error('Unable to parse google.protobuf.Any from JSON ' + typeofJsonValue(json) + '.');
251
+ if (typeof json['@type'] != 'string' || json['@type'] == '')
252
+ return this.create();
253
+ const typeName = this.typeUrlToName(json['@type']);
254
+ const type = options?.typeRegistry?.find((t) => t.typeName == typeName);
255
+ if (!type)
256
+ throw new globalThis.Error('Unable to parse google.protobuf.Any from JSON. The specified type ' + typeName + ' is not available in the type registry.');
257
+ let value;
258
+ if (typeName.startsWith('google.protobuf.') && json.hasOwnProperty('value'))
259
+ value = type.fromJson(json['value'], options);
260
+ else {
261
+ const copy = Object.assign({}, json);
262
+ delete copy['@type'];
263
+ value = type.fromJson(copy, options);
309
264
  }
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;
265
+ if (target === undefined)
266
+ target = this.create();
267
+ target.typeUrl = json['@type'];
268
+ target.value = type.toBinary(value);
269
+ return target;
270
+ }
271
+
272
+ typeNameToUrl(name: string): string {
273
+ if (!name.length)
274
+ throw new Error('invalid type name: ' + name);
275
+ return 'type.googleapis.com/' + name;
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
+ }
321
316
  }
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
+ }
322
332
  }
323
333
  /**
324
334
  * @generated MessageType for protobuf message google.protobuf.Any