@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,450 @@
1
+ // @generated by protobuf-ts 2.9.4 with parameter client_generic,optimize_speed,generate_dependencies,force_server_none
2
+ // @generated from protobuf file "github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.proto" (package "MiLaboratories.Controller.Shared", syntax proto3)
3
+ // tslint:disable
4
+ import { ServiceType } from "@protobuf-ts/runtime-rpc";
5
+ import { WireType } from "@protobuf-ts/runtime";
6
+ import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
7
+ import type { IBinaryWriter } from "@protobuf-ts/runtime";
8
+ import { UnknownFieldHandler } from "@protobuf-ts/runtime";
9
+ import type { BinaryReadOptions } from "@protobuf-ts/runtime";
10
+ import type { IBinaryReader } from "@protobuf-ts/runtime";
11
+ import type { PartialMessage } from "@protobuf-ts/runtime";
12
+ import { reflectionMergePartial } from "@protobuf-ts/runtime";
13
+ import { MessageType } from "@protobuf-ts/runtime";
14
+ import { Duration } from "../../../../../../../google/protobuf/duration";
15
+ /**
16
+ * @generated from protobuf message MiLaboratories.Controller.Shared.ProgressAPI
17
+ */
18
+ export interface ProgressAPI {
19
+ }
20
+ /**
21
+ * @generated from protobuf message MiLaboratories.Controller.Shared.ProgressAPI.Report
22
+ */
23
+ export interface ProgressAPI_Report {
24
+ /**
25
+ * @generated from protobuf field: float progress = 1;
26
+ */
27
+ progress: number;
28
+ /**
29
+ * @generated from protobuf field: uint64 bytes_processed = 2;
30
+ */
31
+ bytesProcessed: bigint;
32
+ /**
33
+ * @generated from protobuf field: uint64 bytes_total = 3;
34
+ */
35
+ bytesTotal: bigint;
36
+ /**
37
+ * @generated from protobuf field: bool done = 4;
38
+ */
39
+ done: boolean;
40
+ /**
41
+ * Name of current progress stage (if any)
42
+ *
43
+ * @generated from protobuf field: string name = 5;
44
+ */
45
+ name: string;
46
+ }
47
+ /**
48
+ * @generated from protobuf message MiLaboratories.Controller.Shared.ProgressAPI.GetStatus
49
+ */
50
+ export interface ProgressAPI_GetStatus {
51
+ }
52
+ /**
53
+ * @generated from protobuf message MiLaboratories.Controller.Shared.ProgressAPI.GetStatus.Request
54
+ */
55
+ export interface ProgressAPI_GetStatus_Request {
56
+ /**
57
+ * @generated from protobuf field: uint64 resource_id = 1;
58
+ */
59
+ resourceId: bigint;
60
+ }
61
+ /**
62
+ * @generated from protobuf message MiLaboratories.Controller.Shared.ProgressAPI.GetStatus.Response
63
+ */
64
+ export interface ProgressAPI_GetStatus_Response {
65
+ /**
66
+ * @generated from protobuf field: MiLaboratories.Controller.Shared.ProgressAPI.Report report = 1;
67
+ */
68
+ report?: ProgressAPI_Report;
69
+ }
70
+ /**
71
+ * @generated from protobuf message MiLaboratories.Controller.Shared.ProgressAPI.RealtimeStatus
72
+ */
73
+ export interface ProgressAPI_RealtimeStatus {
74
+ }
75
+ /**
76
+ * @generated from protobuf message MiLaboratories.Controller.Shared.ProgressAPI.RealtimeStatus.Request
77
+ */
78
+ export interface ProgressAPI_RealtimeStatus_Request {
79
+ /**
80
+ * @generated from protobuf field: uint64 resource_id = 1;
81
+ */
82
+ resourceId: bigint;
83
+ /**
84
+ * @generated from protobuf field: google.protobuf.Duration update_interval = 2;
85
+ */
86
+ updateInterval?: Duration;
87
+ }
88
+ /**
89
+ * @generated from protobuf message MiLaboratories.Controller.Shared.ProgressAPI.RealtimeStatus.Response
90
+ */
91
+ export interface ProgressAPI_RealtimeStatus_Response {
92
+ /**
93
+ * @generated from protobuf field: MiLaboratories.Controller.Shared.ProgressAPI.Report report = 1;
94
+ */
95
+ report?: ProgressAPI_Report;
96
+ }
97
+ // @generated message type with reflection information, may provide speed optimized methods
98
+ class ProgressAPI$Type extends MessageType<ProgressAPI> {
99
+ constructor() {
100
+ super("MiLaboratories.Controller.Shared.ProgressAPI", []);
101
+ }
102
+ create(value?: PartialMessage<ProgressAPI>): ProgressAPI {
103
+ const message = globalThis.Object.create((this.messagePrototype!));
104
+ if (value !== undefined)
105
+ reflectionMergePartial<ProgressAPI>(this, message, value);
106
+ return message;
107
+ }
108
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ProgressAPI): ProgressAPI {
109
+ return target ?? this.create();
110
+ }
111
+ internalBinaryWrite(message: ProgressAPI, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
112
+ let u = options.writeUnknownFields;
113
+ if (u !== false)
114
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
115
+ return writer;
116
+ }
117
+ }
118
+ /**
119
+ * @generated MessageType for protobuf message MiLaboratories.Controller.Shared.ProgressAPI
120
+ */
121
+ export const ProgressAPI = new ProgressAPI$Type();
122
+ // @generated message type with reflection information, may provide speed optimized methods
123
+ class ProgressAPI_Report$Type extends MessageType<ProgressAPI_Report> {
124
+ constructor() {
125
+ super("MiLaboratories.Controller.Shared.ProgressAPI.Report", [
126
+ { no: 1, name: "progress", kind: "scalar", T: 2 /*ScalarType.FLOAT*/ },
127
+ { no: 2, name: "bytes_processed", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ },
128
+ { no: 3, name: "bytes_total", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ },
129
+ { no: 4, name: "done", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
130
+ { no: 5, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
131
+ ]);
132
+ }
133
+ create(value?: PartialMessage<ProgressAPI_Report>): ProgressAPI_Report {
134
+ const message = globalThis.Object.create((this.messagePrototype!));
135
+ message.progress = 0;
136
+ message.bytesProcessed = 0n;
137
+ message.bytesTotal = 0n;
138
+ message.done = false;
139
+ message.name = "";
140
+ if (value !== undefined)
141
+ reflectionMergePartial<ProgressAPI_Report>(this, message, value);
142
+ return message;
143
+ }
144
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ProgressAPI_Report): ProgressAPI_Report {
145
+ let message = target ?? this.create(), end = reader.pos + length;
146
+ while (reader.pos < end) {
147
+ let [fieldNo, wireType] = reader.tag();
148
+ switch (fieldNo) {
149
+ case /* float progress */ 1:
150
+ message.progress = reader.float();
151
+ break;
152
+ case /* uint64 bytes_processed */ 2:
153
+ message.bytesProcessed = reader.uint64().toBigInt();
154
+ break;
155
+ case /* uint64 bytes_total */ 3:
156
+ message.bytesTotal = reader.uint64().toBigInt();
157
+ break;
158
+ case /* bool done */ 4:
159
+ message.done = reader.bool();
160
+ break;
161
+ case /* string name */ 5:
162
+ message.name = reader.string();
163
+ break;
164
+ default:
165
+ let u = options.readUnknownField;
166
+ if (u === "throw")
167
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
168
+ let d = reader.skip(wireType);
169
+ if (u !== false)
170
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
171
+ }
172
+ }
173
+ return message;
174
+ }
175
+ internalBinaryWrite(message: ProgressAPI_Report, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
176
+ /* float progress = 1; */
177
+ if (message.progress !== 0)
178
+ writer.tag(1, WireType.Bit32).float(message.progress);
179
+ /* uint64 bytes_processed = 2; */
180
+ if (message.bytesProcessed !== 0n)
181
+ writer.tag(2, WireType.Varint).uint64(message.bytesProcessed);
182
+ /* uint64 bytes_total = 3; */
183
+ if (message.bytesTotal !== 0n)
184
+ writer.tag(3, WireType.Varint).uint64(message.bytesTotal);
185
+ /* bool done = 4; */
186
+ if (message.done !== false)
187
+ writer.tag(4, WireType.Varint).bool(message.done);
188
+ /* string name = 5; */
189
+ if (message.name !== "")
190
+ writer.tag(5, WireType.LengthDelimited).string(message.name);
191
+ let u = options.writeUnknownFields;
192
+ if (u !== false)
193
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
194
+ return writer;
195
+ }
196
+ }
197
+ /**
198
+ * @generated MessageType for protobuf message MiLaboratories.Controller.Shared.ProgressAPI.Report
199
+ */
200
+ export const ProgressAPI_Report = new ProgressAPI_Report$Type();
201
+ // @generated message type with reflection information, may provide speed optimized methods
202
+ class ProgressAPI_GetStatus$Type extends MessageType<ProgressAPI_GetStatus> {
203
+ constructor() {
204
+ super("MiLaboratories.Controller.Shared.ProgressAPI.GetStatus", []);
205
+ }
206
+ create(value?: PartialMessage<ProgressAPI_GetStatus>): ProgressAPI_GetStatus {
207
+ const message = globalThis.Object.create((this.messagePrototype!));
208
+ if (value !== undefined)
209
+ reflectionMergePartial<ProgressAPI_GetStatus>(this, message, value);
210
+ return message;
211
+ }
212
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ProgressAPI_GetStatus): ProgressAPI_GetStatus {
213
+ return target ?? this.create();
214
+ }
215
+ internalBinaryWrite(message: ProgressAPI_GetStatus, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
216
+ let u = options.writeUnknownFields;
217
+ if (u !== false)
218
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
219
+ return writer;
220
+ }
221
+ }
222
+ /**
223
+ * @generated MessageType for protobuf message MiLaboratories.Controller.Shared.ProgressAPI.GetStatus
224
+ */
225
+ export const ProgressAPI_GetStatus = new ProgressAPI_GetStatus$Type();
226
+ // @generated message type with reflection information, may provide speed optimized methods
227
+ class ProgressAPI_GetStatus_Request$Type extends MessageType<ProgressAPI_GetStatus_Request> {
228
+ constructor() {
229
+ super("MiLaboratories.Controller.Shared.ProgressAPI.GetStatus.Request", [
230
+ { no: 1, name: "resource_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }
231
+ ]);
232
+ }
233
+ create(value?: PartialMessage<ProgressAPI_GetStatus_Request>): ProgressAPI_GetStatus_Request {
234
+ const message = globalThis.Object.create((this.messagePrototype!));
235
+ message.resourceId = 0n;
236
+ if (value !== undefined)
237
+ reflectionMergePartial<ProgressAPI_GetStatus_Request>(this, message, value);
238
+ return message;
239
+ }
240
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ProgressAPI_GetStatus_Request): ProgressAPI_GetStatus_Request {
241
+ let message = target ?? this.create(), end = reader.pos + length;
242
+ while (reader.pos < end) {
243
+ let [fieldNo, wireType] = reader.tag();
244
+ switch (fieldNo) {
245
+ case /* uint64 resource_id */ 1:
246
+ message.resourceId = reader.uint64().toBigInt();
247
+ break;
248
+ default:
249
+ let u = options.readUnknownField;
250
+ if (u === "throw")
251
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
252
+ let d = reader.skip(wireType);
253
+ if (u !== false)
254
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
255
+ }
256
+ }
257
+ return message;
258
+ }
259
+ internalBinaryWrite(message: ProgressAPI_GetStatus_Request, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
260
+ /* uint64 resource_id = 1; */
261
+ if (message.resourceId !== 0n)
262
+ writer.tag(1, WireType.Varint).uint64(message.resourceId);
263
+ let u = options.writeUnknownFields;
264
+ if (u !== false)
265
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
266
+ return writer;
267
+ }
268
+ }
269
+ /**
270
+ * @generated MessageType for protobuf message MiLaboratories.Controller.Shared.ProgressAPI.GetStatus.Request
271
+ */
272
+ export const ProgressAPI_GetStatus_Request = new ProgressAPI_GetStatus_Request$Type();
273
+ // @generated message type with reflection information, may provide speed optimized methods
274
+ class ProgressAPI_GetStatus_Response$Type extends MessageType<ProgressAPI_GetStatus_Response> {
275
+ constructor() {
276
+ super("MiLaboratories.Controller.Shared.ProgressAPI.GetStatus.Response", [
277
+ { no: 1, name: "report", kind: "message", T: () => ProgressAPI_Report }
278
+ ]);
279
+ }
280
+ create(value?: PartialMessage<ProgressAPI_GetStatus_Response>): ProgressAPI_GetStatus_Response {
281
+ const message = globalThis.Object.create((this.messagePrototype!));
282
+ if (value !== undefined)
283
+ reflectionMergePartial<ProgressAPI_GetStatus_Response>(this, message, value);
284
+ return message;
285
+ }
286
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ProgressAPI_GetStatus_Response): ProgressAPI_GetStatus_Response {
287
+ let message = target ?? this.create(), end = reader.pos + length;
288
+ while (reader.pos < end) {
289
+ let [fieldNo, wireType] = reader.tag();
290
+ switch (fieldNo) {
291
+ case /* MiLaboratories.Controller.Shared.ProgressAPI.Report report */ 1:
292
+ message.report = ProgressAPI_Report.internalBinaryRead(reader, reader.uint32(), options, message.report);
293
+ break;
294
+ default:
295
+ let u = options.readUnknownField;
296
+ if (u === "throw")
297
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
298
+ let d = reader.skip(wireType);
299
+ if (u !== false)
300
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
301
+ }
302
+ }
303
+ return message;
304
+ }
305
+ internalBinaryWrite(message: ProgressAPI_GetStatus_Response, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
306
+ /* MiLaboratories.Controller.Shared.ProgressAPI.Report report = 1; */
307
+ if (message.report)
308
+ ProgressAPI_Report.internalBinaryWrite(message.report, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
309
+ let u = options.writeUnknownFields;
310
+ if (u !== false)
311
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
312
+ return writer;
313
+ }
314
+ }
315
+ /**
316
+ * @generated MessageType for protobuf message MiLaboratories.Controller.Shared.ProgressAPI.GetStatus.Response
317
+ */
318
+ export const ProgressAPI_GetStatus_Response = new ProgressAPI_GetStatus_Response$Type();
319
+ // @generated message type with reflection information, may provide speed optimized methods
320
+ class ProgressAPI_RealtimeStatus$Type extends MessageType<ProgressAPI_RealtimeStatus> {
321
+ constructor() {
322
+ super("MiLaboratories.Controller.Shared.ProgressAPI.RealtimeStatus", []);
323
+ }
324
+ create(value?: PartialMessage<ProgressAPI_RealtimeStatus>): ProgressAPI_RealtimeStatus {
325
+ const message = globalThis.Object.create((this.messagePrototype!));
326
+ if (value !== undefined)
327
+ reflectionMergePartial<ProgressAPI_RealtimeStatus>(this, message, value);
328
+ return message;
329
+ }
330
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ProgressAPI_RealtimeStatus): ProgressAPI_RealtimeStatus {
331
+ return target ?? this.create();
332
+ }
333
+ internalBinaryWrite(message: ProgressAPI_RealtimeStatus, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
334
+ let u = options.writeUnknownFields;
335
+ if (u !== false)
336
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
337
+ return writer;
338
+ }
339
+ }
340
+ /**
341
+ * @generated MessageType for protobuf message MiLaboratories.Controller.Shared.ProgressAPI.RealtimeStatus
342
+ */
343
+ export const ProgressAPI_RealtimeStatus = new ProgressAPI_RealtimeStatus$Type();
344
+ // @generated message type with reflection information, may provide speed optimized methods
345
+ class ProgressAPI_RealtimeStatus_Request$Type extends MessageType<ProgressAPI_RealtimeStatus_Request> {
346
+ constructor() {
347
+ super("MiLaboratories.Controller.Shared.ProgressAPI.RealtimeStatus.Request", [
348
+ { no: 1, name: "resource_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ },
349
+ { no: 2, name: "update_interval", kind: "message", T: () => Duration }
350
+ ]);
351
+ }
352
+ create(value?: PartialMessage<ProgressAPI_RealtimeStatus_Request>): ProgressAPI_RealtimeStatus_Request {
353
+ const message = globalThis.Object.create((this.messagePrototype!));
354
+ message.resourceId = 0n;
355
+ if (value !== undefined)
356
+ reflectionMergePartial<ProgressAPI_RealtimeStatus_Request>(this, message, value);
357
+ return message;
358
+ }
359
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ProgressAPI_RealtimeStatus_Request): ProgressAPI_RealtimeStatus_Request {
360
+ let message = target ?? this.create(), end = reader.pos + length;
361
+ while (reader.pos < end) {
362
+ let [fieldNo, wireType] = reader.tag();
363
+ switch (fieldNo) {
364
+ case /* uint64 resource_id */ 1:
365
+ message.resourceId = reader.uint64().toBigInt();
366
+ break;
367
+ case /* google.protobuf.Duration update_interval */ 2:
368
+ message.updateInterval = Duration.internalBinaryRead(reader, reader.uint32(), options, message.updateInterval);
369
+ break;
370
+ default:
371
+ let u = options.readUnknownField;
372
+ if (u === "throw")
373
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
374
+ let d = reader.skip(wireType);
375
+ if (u !== false)
376
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
377
+ }
378
+ }
379
+ return message;
380
+ }
381
+ internalBinaryWrite(message: ProgressAPI_RealtimeStatus_Request, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
382
+ /* uint64 resource_id = 1; */
383
+ if (message.resourceId !== 0n)
384
+ writer.tag(1, WireType.Varint).uint64(message.resourceId);
385
+ /* google.protobuf.Duration update_interval = 2; */
386
+ if (message.updateInterval)
387
+ Duration.internalBinaryWrite(message.updateInterval, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
388
+ let u = options.writeUnknownFields;
389
+ if (u !== false)
390
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
391
+ return writer;
392
+ }
393
+ }
394
+ /**
395
+ * @generated MessageType for protobuf message MiLaboratories.Controller.Shared.ProgressAPI.RealtimeStatus.Request
396
+ */
397
+ export const ProgressAPI_RealtimeStatus_Request = new ProgressAPI_RealtimeStatus_Request$Type();
398
+ // @generated message type with reflection information, may provide speed optimized methods
399
+ class ProgressAPI_RealtimeStatus_Response$Type extends MessageType<ProgressAPI_RealtimeStatus_Response> {
400
+ constructor() {
401
+ super("MiLaboratories.Controller.Shared.ProgressAPI.RealtimeStatus.Response", [
402
+ { no: 1, name: "report", kind: "message", T: () => ProgressAPI_Report }
403
+ ]);
404
+ }
405
+ create(value?: PartialMessage<ProgressAPI_RealtimeStatus_Response>): ProgressAPI_RealtimeStatus_Response {
406
+ const message = globalThis.Object.create((this.messagePrototype!));
407
+ if (value !== undefined)
408
+ reflectionMergePartial<ProgressAPI_RealtimeStatus_Response>(this, message, value);
409
+ return message;
410
+ }
411
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ProgressAPI_RealtimeStatus_Response): ProgressAPI_RealtimeStatus_Response {
412
+ let message = target ?? this.create(), end = reader.pos + length;
413
+ while (reader.pos < end) {
414
+ let [fieldNo, wireType] = reader.tag();
415
+ switch (fieldNo) {
416
+ case /* MiLaboratories.Controller.Shared.ProgressAPI.Report report */ 1:
417
+ message.report = ProgressAPI_Report.internalBinaryRead(reader, reader.uint32(), options, message.report);
418
+ break;
419
+ default:
420
+ let u = options.readUnknownField;
421
+ if (u === "throw")
422
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
423
+ let d = reader.skip(wireType);
424
+ if (u !== false)
425
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
426
+ }
427
+ }
428
+ return message;
429
+ }
430
+ internalBinaryWrite(message: ProgressAPI_RealtimeStatus_Response, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
431
+ /* MiLaboratories.Controller.Shared.ProgressAPI.Report report = 1; */
432
+ if (message.report)
433
+ ProgressAPI_Report.internalBinaryWrite(message.report, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
434
+ let u = options.writeUnknownFields;
435
+ if (u !== false)
436
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
437
+ return writer;
438
+ }
439
+ }
440
+ /**
441
+ * @generated MessageType for protobuf message MiLaboratories.Controller.Shared.ProgressAPI.RealtimeStatus.Response
442
+ */
443
+ export const ProgressAPI_RealtimeStatus_Response = new ProgressAPI_RealtimeStatus_Response$Type();
444
+ /**
445
+ * @generated ServiceType for protobuf service MiLaboratories.Controller.Shared.Progress
446
+ */
447
+ export const Progress = new ServiceType("MiLaboratories.Controller.Shared.Progress", [
448
+ { name: "GetStatus", options: { "google.api.http": { get: "/resources/{resource_id}/get-progress" } }, I: ProgressAPI_GetStatus_Request, O: ProgressAPI_GetStatus_Response },
449
+ { name: "RealtimeStatus", serverStreaming: true, options: {}, I: ProgressAPI_RealtimeStatus_Request, O: ProgressAPI_RealtimeStatus_Response }
450
+ ]);
@@ -0,0 +1,148 @@
1
+ // @generated by protobuf-ts 2.9.4 with parameter client_generic,optimize_speed,generate_dependencies,force_server_none
2
+ // @generated from protobuf file "github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.proto" (package "MiLaboratories.Controller.Shared", syntax proto3)
3
+ // tslint:disable
4
+ import type { RpcTransport } from "@protobuf-ts/runtime-rpc";
5
+ import type { ServiceInfo } from "@protobuf-ts/runtime-rpc";
6
+ import { Streaming } from "./protocol";
7
+ import type { StreamingAPI_LastLines } from "./protocol";
8
+ import type { StreamingAPI_ReadText } from "./protocol";
9
+ import type { StreamingAPI_StreamText } from "./protocol";
10
+ import type { StreamingAPI_ReadBinary } from "./protocol";
11
+ import type { UnaryCall } from "@protobuf-ts/runtime-rpc";
12
+ import { stackIntercept } from "@protobuf-ts/runtime-rpc";
13
+ import type { StreamingAPI_Response } from "./protocol";
14
+ import type { StreamingAPI_StreamBinary } from "./protocol";
15
+ import type { ServerStreamingCall } from "@protobuf-ts/runtime-rpc";
16
+ import type { RpcOptions } from "@protobuf-ts/runtime-rpc";
17
+ /**
18
+ *
19
+ * Streaming provides access to online data stream from item in storage. Whenever item is appended with data,
20
+ * the caller receives this fresh data in stream from server.
21
+ *
22
+ *
23
+ * @generated from protobuf service MiLaboratories.Controller.Shared.Streaming
24
+ */
25
+ export interface IStreamingClient {
26
+ /**
27
+ * StreamBinary provides stream of binary file. Each response message keeps
28
+ * one single chunk of binary data from data source. See StreamingAPI.Binary message
29
+ * for more info on available options.
30
+ *
31
+ * @generated from protobuf rpc: StreamBinary(MiLaboratories.Controller.Shared.StreamingAPI.StreamBinary) returns (stream MiLaboratories.Controller.Shared.StreamingAPI.Response);
32
+ */
33
+ streamBinary(input: StreamingAPI_StreamBinary, options?: RpcOptions): ServerStreamingCall<StreamingAPI_StreamBinary, StreamingAPI_Response>;
34
+ /**
35
+ * ReadBinary allows to read remote item in chunks using stream-like API.
36
+ * The difference to StreamBinary is that the client receives single response for each
37
+ * call and has to send new calls to the server to get fresh data from remote item.
38
+ * Each response (each chunk from server) keeps not more than 3.9MiB of data.
39
+ *
40
+ * @generated from protobuf rpc: ReadBinary(MiLaboratories.Controller.Shared.StreamingAPI.ReadBinary) returns (MiLaboratories.Controller.Shared.StreamingAPI.Response);
41
+ */
42
+ readBinary(input: StreamingAPI_ReadBinary, options?: RpcOptions): UnaryCall<StreamingAPI_ReadBinary, StreamingAPI_Response>;
43
+ /**
44
+ * StreamText provides stream of textual file, splitting the data by newline symbol.
45
+ * Each response message keeps one single line of text from data source.
46
+ *
47
+ * @generated from protobuf rpc: StreamText(MiLaboratories.Controller.Shared.StreamingAPI.StreamText) returns (stream MiLaboratories.Controller.Shared.StreamingAPI.Response);
48
+ */
49
+ streamText(input: StreamingAPI_StreamText, options?: RpcOptions): ServerStreamingCall<StreamingAPI_StreamText, StreamingAPI_Response>;
50
+ /**
51
+ * ReadBinary allows to read remote item in chunks using stream-like API.
52
+ * The difference to StreamBinary is that the client receives single response for each
53
+ * call and has to send new calls to the server to get fresh data from remote item.
54
+ * Each response (each chunk from server) keeps not more than 3.9MiB of data.
55
+ *
56
+ * @generated from protobuf rpc: ReadText(MiLaboratories.Controller.Shared.StreamingAPI.ReadText) returns (MiLaboratories.Controller.Shared.StreamingAPI.Response);
57
+ */
58
+ readText(input: StreamingAPI_ReadText, options?: RpcOptions): UnaryCall<StreamingAPI_ReadText, StreamingAPI_Response>;
59
+ /**
60
+ * LastLines provides single message with the last lines from data source.
61
+ * When search pattern is specified, the last lines matching the given pattern are returned.
62
+ * The lines are returned in reversed order, as server reads data source from the end.
63
+ * Consider it as equivalent to 'tac <file> | grep <search> | head -n <line_count>'
64
+ * The <new_offset> returned in the response points to the _beginning_ of the last
65
+ * line found, so client can continue reading the file backwards in subsequent calls.
66
+ * This means, that use of this <new_offset> in ReadText() will return you the same line
67
+ * returned last in LastLines() data.
68
+ *
69
+ * @generated from protobuf rpc: LastLines(MiLaboratories.Controller.Shared.StreamingAPI.LastLines) returns (MiLaboratories.Controller.Shared.StreamingAPI.Response);
70
+ */
71
+ lastLines(input: StreamingAPI_LastLines, options?: RpcOptions): UnaryCall<StreamingAPI_LastLines, StreamingAPI_Response>;
72
+ }
73
+ /**
74
+ *
75
+ * Streaming provides access to online data stream from item in storage. Whenever item is appended with data,
76
+ * the caller receives this fresh data in stream from server.
77
+ *
78
+ *
79
+ * @generated from protobuf service MiLaboratories.Controller.Shared.Streaming
80
+ */
81
+ export class StreamingClient implements IStreamingClient, ServiceInfo {
82
+ typeName = Streaming.typeName;
83
+ methods = Streaming.methods;
84
+ options = Streaming.options;
85
+ constructor(private readonly _transport: RpcTransport) {
86
+ }
87
+ /**
88
+ * StreamBinary provides stream of binary file. Each response message keeps
89
+ * one single chunk of binary data from data source. See StreamingAPI.Binary message
90
+ * for more info on available options.
91
+ *
92
+ * @generated from protobuf rpc: StreamBinary(MiLaboratories.Controller.Shared.StreamingAPI.StreamBinary) returns (stream MiLaboratories.Controller.Shared.StreamingAPI.Response);
93
+ */
94
+ streamBinary(input: StreamingAPI_StreamBinary, options?: RpcOptions): ServerStreamingCall<StreamingAPI_StreamBinary, StreamingAPI_Response> {
95
+ const method = this.methods[0], opt = this._transport.mergeOptions(options);
96
+ return stackIntercept<StreamingAPI_StreamBinary, StreamingAPI_Response>("serverStreaming", this._transport, method, opt, input);
97
+ }
98
+ /**
99
+ * ReadBinary allows to read remote item in chunks using stream-like API.
100
+ * The difference to StreamBinary is that the client receives single response for each
101
+ * call and has to send new calls to the server to get fresh data from remote item.
102
+ * Each response (each chunk from server) keeps not more than 3.9MiB of data.
103
+ *
104
+ * @generated from protobuf rpc: ReadBinary(MiLaboratories.Controller.Shared.StreamingAPI.ReadBinary) returns (MiLaboratories.Controller.Shared.StreamingAPI.Response);
105
+ */
106
+ readBinary(input: StreamingAPI_ReadBinary, options?: RpcOptions): UnaryCall<StreamingAPI_ReadBinary, StreamingAPI_Response> {
107
+ const method = this.methods[1], opt = this._transport.mergeOptions(options);
108
+ return stackIntercept<StreamingAPI_ReadBinary, StreamingAPI_Response>("unary", this._transport, method, opt, input);
109
+ }
110
+ /**
111
+ * StreamText provides stream of textual file, splitting the data by newline symbol.
112
+ * Each response message keeps one single line of text from data source.
113
+ *
114
+ * @generated from protobuf rpc: StreamText(MiLaboratories.Controller.Shared.StreamingAPI.StreamText) returns (stream MiLaboratories.Controller.Shared.StreamingAPI.Response);
115
+ */
116
+ streamText(input: StreamingAPI_StreamText, options?: RpcOptions): ServerStreamingCall<StreamingAPI_StreamText, StreamingAPI_Response> {
117
+ const method = this.methods[2], opt = this._transport.mergeOptions(options);
118
+ return stackIntercept<StreamingAPI_StreamText, StreamingAPI_Response>("serverStreaming", this._transport, method, opt, input);
119
+ }
120
+ /**
121
+ * ReadBinary allows to read remote item in chunks using stream-like API.
122
+ * The difference to StreamBinary is that the client receives single response for each
123
+ * call and has to send new calls to the server to get fresh data from remote item.
124
+ * Each response (each chunk from server) keeps not more than 3.9MiB of data.
125
+ *
126
+ * @generated from protobuf rpc: ReadText(MiLaboratories.Controller.Shared.StreamingAPI.ReadText) returns (MiLaboratories.Controller.Shared.StreamingAPI.Response);
127
+ */
128
+ readText(input: StreamingAPI_ReadText, options?: RpcOptions): UnaryCall<StreamingAPI_ReadText, StreamingAPI_Response> {
129
+ const method = this.methods[3], opt = this._transport.mergeOptions(options);
130
+ return stackIntercept<StreamingAPI_ReadText, StreamingAPI_Response>("unary", this._transport, method, opt, input);
131
+ }
132
+ /**
133
+ * LastLines provides single message with the last lines from data source.
134
+ * When search pattern is specified, the last lines matching the given pattern are returned.
135
+ * The lines are returned in reversed order, as server reads data source from the end.
136
+ * Consider it as equivalent to 'tac <file> | grep <search> | head -n <line_count>'
137
+ * The <new_offset> returned in the response points to the _beginning_ of the last
138
+ * line found, so client can continue reading the file backwards in subsequent calls.
139
+ * This means, that use of this <new_offset> in ReadText() will return you the same line
140
+ * returned last in LastLines() data.
141
+ *
142
+ * @generated from protobuf rpc: LastLines(MiLaboratories.Controller.Shared.StreamingAPI.LastLines) returns (MiLaboratories.Controller.Shared.StreamingAPI.Response);
143
+ */
144
+ lastLines(input: StreamingAPI_LastLines, options?: RpcOptions): UnaryCall<StreamingAPI_LastLines, StreamingAPI_Response> {
145
+ const method = this.methods[4], opt = this._transport.mergeOptions(options);
146
+ return stackIntercept<StreamingAPI_LastLines, StreamingAPI_Response>("unary", this._transport, method, opt, input);
147
+ }
148
+ }