@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.
- package/dist/core/auth.d.ts.map +1 -1
- package/dist/core/cache.d.ts.map +1 -1
- package/dist/core/client.d.ts +1 -1
- package/dist/core/client.d.ts.map +1 -1
- package/dist/core/default_client.d.ts.map +1 -1
- package/dist/core/driver.d.ts.map +1 -1
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/final.d.ts.map +1 -1
- package/dist/core/ll_client.d.ts.map +1 -1
- package/dist/core/ll_transaction.d.ts.map +1 -1
- package/dist/core/transaction.d.ts +1 -1
- package/dist/core/transaction.d.ts.map +1 -1
- package/dist/core/type_conversion.d.ts.map +1 -1
- package/dist/core/types.d.ts +1 -1
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/unauth_client.d.ts.map +1 -1
- package/dist/helpers/pl.d.ts.map +1 -1
- package/dist/helpers/poll.d.ts.map +1 -1
- package/dist/helpers/state_helpers.d.ts.map +1 -1
- package/dist/helpers/tx_helpers.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4069 -4075
- 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/downloadapi/protocol.client.d.ts +4 -4
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.client.d.ts.map +1 -1
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.d.ts +16 -16
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.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/progressapi/protocol.client.d.ts +8 -8
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.client.d.ts.map +1 -1
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.d.ts +22 -22
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/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 +773 -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/api/http.d.ts +89 -89
- package/dist/proto/google/api/http.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/descriptor.d.ts +1151 -1151
- package/dist/proto/google/protobuf/descriptor.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/dist/test/test_config.d.ts.map +1 -1
- package/dist/util/util.d.ts.map +1 -1
- package/package.json +7 -3
- package/src/core/auth.ts +3 -3
- package/src/core/cache.ts +1 -1
- package/src/core/client.ts +39 -31
- package/src/core/config.ts +21 -21
- package/src/core/default_client.ts +15 -14
- package/src/core/driver.ts +4 -4
- package/src/core/errors.ts +3 -3
- package/src/core/final.ts +7 -4
- package/src/core/ll_client.ts +31 -27
- package/src/core/ll_transaction.ts +17 -17
- package/src/core/stat.ts +2 -2
- package/src/core/transaction.ts +93 -95
- package/src/core/type_conversion.ts +11 -8
- package/src/core/types.ts +25 -26
- package/src/core/unauth_client.ts +6 -6
- package/src/helpers/pl.ts +8 -7
- package/src/helpers/poll.ts +25 -21
- package/src/helpers/state_helpers.ts +2 -1
- package/src/helpers/tx_helpers.ts +4 -3
- package/src/proto/github.com/googleapis/googleapis/google/rpc/status.ts +74 -71
- package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.client.ts +21 -20
- package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.ts +240 -225
- package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.client.ts +21 -20
- package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.ts +290 -275
- package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.client.ts +32 -30
- package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.ts +388 -364
- package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.client.ts +58 -53
- package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.ts +490 -469
- package/src/proto/github.com/milaboratory/pl/plapi/plapiproto/api.client.ts +262 -237
- package/src/proto/github.com/milaboratory/pl/plapi/plapiproto/api.ts +11751 -11032
- package/src/proto/github.com/milaboratory/pl/plapi/plapiproto/api_types.ts +1155 -1114
- package/src/proto/github.com/milaboratory/pl/plapi/plapiproto/base_types.ts +131 -125
- package/src/proto/github.com/milaboratory/pl/plapi/plapiproto/import.ts +203 -200
- package/src/proto/github.com/milaboratory/pl/plapi/plapiproto/resource_types.ts +559 -540
- package/src/proto/google/api/http.ts +280 -271
- package/src/proto/google/protobuf/any.ts +149 -139
- package/src/proto/google/protobuf/descriptor.ts +2952 -2853
- package/src/proto/google/protobuf/duration.ts +107 -102
- package/src/proto/google/protobuf/empty.ts +41 -38
- package/src/proto/google/protobuf/struct.ts +336 -322
- package/src/proto/google/protobuf/timestamp.ts +131 -123
- package/src/proto/google/protobuf/wrappers.ts +536 -491
- package/src/test/test_config.ts +21 -19
- 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
|
|
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,51 +172,55 @@ 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
|
-
|
|
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
|
-
|
|
197
|
-
|
|
198
|
-
|
|
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
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
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
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
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
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
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
|
-
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
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
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
|