@milaboratories/pl-drivers 1.2.16

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 (117) hide show
  1. package/README.md +18 -0
  2. package/dist/clients/download.d.ts +30 -0
  3. package/dist/clients/download.d.ts.map +1 -0
  4. package/dist/clients/helpers.d.ts +14 -0
  5. package/dist/clients/helpers.d.ts.map +1 -0
  6. package/dist/clients/logs.d.ts +26 -0
  7. package/dist/clients/logs.d.ts.map +1 -0
  8. package/dist/clients/ls_api.d.ts +13 -0
  9. package/dist/clients/ls_api.d.ts.map +1 -0
  10. package/dist/clients/progress.d.ts +25 -0
  11. package/dist/clients/progress.d.ts.map +1 -0
  12. package/dist/clients/upload.d.ts +38 -0
  13. package/dist/clients/upload.d.ts.map +1 -0
  14. package/dist/drivers/download_and_logs_blob.d.ts +106 -0
  15. package/dist/drivers/download_and_logs_blob.d.ts.map +1 -0
  16. package/dist/drivers/download_url.d.ts +70 -0
  17. package/dist/drivers/download_url.d.ts.map +1 -0
  18. package/dist/drivers/helpers/files_cache.d.ts +28 -0
  19. package/dist/drivers/helpers/files_cache.d.ts.map +1 -0
  20. package/dist/drivers/helpers/helpers.d.ts +34 -0
  21. package/dist/drivers/helpers/helpers.d.ts.map +1 -0
  22. package/dist/drivers/helpers/ls_list_entry.d.ts +49 -0
  23. package/dist/drivers/helpers/ls_list_entry.d.ts.map +1 -0
  24. package/dist/drivers/helpers/ls_storage_entry.d.ts +25 -0
  25. package/dist/drivers/helpers/ls_storage_entry.d.ts.map +1 -0
  26. package/dist/drivers/helpers/polling_ops.d.ts +8 -0
  27. package/dist/drivers/helpers/polling_ops.d.ts.map +1 -0
  28. package/dist/drivers/helpers/test_helpers.d.ts +2 -0
  29. package/dist/drivers/helpers/test_helpers.d.ts.map +1 -0
  30. package/dist/drivers/logs.d.ts +29 -0
  31. package/dist/drivers/logs.d.ts.map +1 -0
  32. package/dist/drivers/logs_stream.d.ts +50 -0
  33. package/dist/drivers/logs_stream.d.ts.map +1 -0
  34. package/dist/drivers/ls.d.ts +30 -0
  35. package/dist/drivers/ls.d.ts.map +1 -0
  36. package/dist/drivers/upload.d.ts +87 -0
  37. package/dist/drivers/upload.d.ts.map +1 -0
  38. package/dist/helpers/download.d.ts +15 -0
  39. package/dist/helpers/download.d.ts.map +1 -0
  40. package/dist/index.cjs +2 -0
  41. package/dist/index.cjs.map +1 -0
  42. package/dist/index.d.ts +15 -0
  43. package/dist/index.d.ts.map +1 -0
  44. package/dist/index.js +4627 -0
  45. package/dist/index.js.map +1 -0
  46. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.client.d.ts +36 -0
  47. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.client.d.ts.map +1 -0
  48. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.d.ts +103 -0
  49. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.d.ts.map +1 -0
  50. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.client.d.ts +42 -0
  51. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.client.d.ts.map +1 -0
  52. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.d.ts +165 -0
  53. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.d.ts.map +1 -0
  54. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.client.d.ts +44 -0
  55. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.client.d.ts.map +1 -0
  56. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.d.ts +171 -0
  57. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.d.ts.map +1 -0
  58. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.client.d.ts +122 -0
  59. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.client.d.ts.map +1 -0
  60. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.d.ts +315 -0
  61. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.d.ts.map +1 -0
  62. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.client.d.ts +98 -0
  63. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.client.d.ts.map +1 -0
  64. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.d.ts +337 -0
  65. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.d.ts.map +1 -0
  66. package/dist/proto/google/api/http.d.ts +451 -0
  67. package/dist/proto/google/api/http.d.ts.map +1 -0
  68. package/dist/proto/google/protobuf/descriptor.d.ts +1646 -0
  69. package/dist/proto/google/protobuf/descriptor.d.ts.map +1 -0
  70. package/dist/proto/google/protobuf/duration.d.ts +106 -0
  71. package/dist/proto/google/protobuf/duration.d.ts.map +1 -0
  72. package/dist/proto/google/protobuf/timestamp.d.ts +151 -0
  73. package/dist/proto/google/protobuf/timestamp.d.ts.map +1 -0
  74. package/package.json +47 -0
  75. package/src/clients/download.test.ts +45 -0
  76. package/src/clients/download.ts +106 -0
  77. package/src/clients/helpers.ts +84 -0
  78. package/src/clients/logs.ts +68 -0
  79. package/src/clients/ls_api.ts +34 -0
  80. package/src/clients/progress.ts +86 -0
  81. package/src/clients/upload.test.ts +30 -0
  82. package/src/clients/upload.ts +199 -0
  83. package/src/drivers/download_and_logs_blob.ts +801 -0
  84. package/src/drivers/download_blob.test.ts +223 -0
  85. package/src/drivers/download_url.test.ts +90 -0
  86. package/src/drivers/download_url.ts +314 -0
  87. package/src/drivers/helpers/files_cache.test.ts +79 -0
  88. package/src/drivers/helpers/files_cache.ts +74 -0
  89. package/src/drivers/helpers/helpers.ts +136 -0
  90. package/src/drivers/helpers/ls_list_entry.test.ts +57 -0
  91. package/src/drivers/helpers/ls_list_entry.ts +152 -0
  92. package/src/drivers/helpers/ls_storage_entry.ts +135 -0
  93. package/src/drivers/helpers/polling_ops.ts +7 -0
  94. package/src/drivers/helpers/test_helpers.ts +5 -0
  95. package/src/drivers/logs.test.ts +337 -0
  96. package/src/drivers/logs.ts +214 -0
  97. package/src/drivers/logs_stream.ts +399 -0
  98. package/src/drivers/ls.test.ts +90 -0
  99. package/src/drivers/ls.ts +147 -0
  100. package/src/drivers/upload.test.ts +454 -0
  101. package/src/drivers/upload.ts +499 -0
  102. package/src/helpers/download.ts +43 -0
  103. package/src/index.ts +15 -0
  104. package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.client.ts +60 -0
  105. package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.ts +442 -0
  106. package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.client.ts +63 -0
  107. package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.ts +503 -0
  108. package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.client.ts +84 -0
  109. package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.ts +697 -0
  110. package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.client.ts +212 -0
  111. package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.ts +1036 -0
  112. package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.client.ts +170 -0
  113. package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.ts +1201 -0
  114. package/src/proto/google/api/http.ts +838 -0
  115. package/src/proto/google/protobuf/descriptor.ts +5173 -0
  116. package/src/proto/google/protobuf/duration.ts +272 -0
  117. package/src/proto/google/protobuf/timestamp.ts +354 -0
@@ -0,0 +1,1201 @@
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/uploadapi/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
+ /**
15
+ * @generated from protobuf message MiLaboratories.Controller.Shared.uploadapi
16
+ */
17
+ export interface uploadapi {}
18
+ /**
19
+ * @generated from protobuf message MiLaboratories.Controller.Shared.uploadapi.Init
20
+ */
21
+ export interface uploadapi_Init {}
22
+ /**
23
+ * @generated from protobuf message MiLaboratories.Controller.Shared.uploadapi.Init.Request
24
+ */
25
+ export interface uploadapi_Init_Request {
26
+ /**
27
+ * Id of upload resource
28
+ *
29
+ * @generated from protobuf field: uint64 resource_id = 1;
30
+ */
31
+ resourceId: bigint;
32
+ }
33
+ /**
34
+ * @generated from protobuf message MiLaboratories.Controller.Shared.uploadapi.Init.Response
35
+ */
36
+ export interface uploadapi_Init_Response {
37
+ /**
38
+ * Number of parts in this upload.
39
+ * For parallel upload support, client can generate any number of part upload URLs
40
+ * at the moment and upload them in parallel.
41
+ * <parts_count> keeps the number of chunks supported by this upload.
42
+ * The parts count is calculated from the planned size of the upload, controller
43
+ * configuration and underlying storage restrictions.
44
+ *
45
+ * @generated from protobuf field: uint64 parts_count = 1;
46
+ */
47
+ partsCount: bigint;
48
+ /**
49
+ * List of IDs of parts that were already uploaded by client.
50
+ * Helps client to recover upload and skip already done parts
51
+ * after being interrupted in the middle of the upload
52
+ * (say, because of the restart).
53
+ * Parts enumeration starts from 1.
54
+ *
55
+ * @generated from protobuf field: repeated uint64 uploaded_parts = 2;
56
+ */
57
+ uploadedParts: bigint[];
58
+ }
59
+ /**
60
+ * @generated from protobuf message MiLaboratories.Controller.Shared.uploadapi.UpdateProgress
61
+ */
62
+ export interface uploadapi_UpdateProgress {}
63
+ /**
64
+ * @generated from protobuf message MiLaboratories.Controller.Shared.uploadapi.UpdateProgress.Request
65
+ */
66
+ export interface uploadapi_UpdateProgress_Request {
67
+ /**
68
+ * Id of upload resource
69
+ *
70
+ * @generated from protobuf field: uint64 resource_id = 1;
71
+ */
72
+ resourceId: bigint;
73
+ /**
74
+ * Amount of bytes, uploaded since the earlier call to UpdateProgress.
75
+ * This value is just blindly added to the 'bytes_processed' of progress report,
76
+ * so other clients can see the upload progress.
77
+ * If client uploads the data in several streams (several chunks in parallel), it
78
+ * can safely send progress updates individually for each of the streams, just counting
79
+ * bytes uploaded by particular stream.
80
+ *
81
+ * Negative value can be used to report about upload retry: when upload was interrupted,
82
+ * part of the uploaded data is lost and require re-upload.
83
+ *
84
+ * @generated from protobuf field: int64 bytes_processed = 2;
85
+ */
86
+ bytesProcessed: bigint;
87
+ }
88
+ /**
89
+ * @generated from protobuf message MiLaboratories.Controller.Shared.uploadapi.UpdateProgress.Response
90
+ */
91
+ export interface uploadapi_UpdateProgress_Response {}
92
+ /**
93
+ * @generated from protobuf message MiLaboratories.Controller.Shared.uploadapi.GetPartURL
94
+ */
95
+ export interface uploadapi_GetPartURL {}
96
+ /**
97
+ * @generated from protobuf message MiLaboratories.Controller.Shared.uploadapi.GetPartURL.Request
98
+ */
99
+ export interface uploadapi_GetPartURL_Request {
100
+ /**
101
+ * Id of upload resource
102
+ *
103
+ * @generated from protobuf field: uint64 resource_id = 1;
104
+ */
105
+ resourceId: bigint;
106
+ /**
107
+ * Part to be uploaded. It is responsibility of the Client to watch after already uploaded parts:
108
+ * - client can request an URL for the same part twice (request -> request) without errors;
109
+ * - client can request an URL for alrady uploaded part (request -> upload -> request) without errors.
110
+ *
111
+ * Parts enumeration starts from 1.
112
+ *
113
+ * @generated from protobuf field: uint64 part_number = 2;
114
+ */
115
+ partNumber: bigint;
116
+ /**
117
+ * Size of the part uploaded by client earlier. Allows controller to count upload progress
118
+ * based on client's input.
119
+ * Client is free to never sent this value (send zeroes in each request).
120
+ *
121
+ * @generated from protobuf field: uint64 uploaded_part_size = 3;
122
+ */
123
+ uploadedPartSize: bigint;
124
+ }
125
+ /**
126
+ * @generated from protobuf message MiLaboratories.Controller.Shared.uploadapi.GetPartURL.HTTPHeader
127
+ */
128
+ export interface uploadapi_GetPartURL_HTTPHeader {
129
+ /**
130
+ * @generated from protobuf field: string Name = 1 [json_name = "Name"];
131
+ */
132
+ name: string;
133
+ /**
134
+ * @generated from protobuf field: string Value = 2 [json_name = "Value"];
135
+ */
136
+ value: string;
137
+ }
138
+ /**
139
+ * @generated from protobuf message MiLaboratories.Controller.Shared.uploadapi.GetPartURL.Response
140
+ */
141
+ export interface uploadapi_GetPartURL_Response {
142
+ /**
143
+ * URL for chunk upload
144
+ *
145
+ * @generated from protobuf field: string upload_url = 1;
146
+ */
147
+ uploadUrl: string;
148
+ /**
149
+ * HTTP method to use for chunk upload, say 'PUT' or 'POST'.
150
+ *
151
+ * @generated from protobuf field: string method = 2;
152
+ */
153
+ method: string;
154
+ /**
155
+ * List of headers with their values, MANDATORY to be sent by the client for the upload.
156
+ * The destination service (the one, that will handle upload request for specific part)
157
+ * may reject the request if it would not keep the given headers.
158
+ *
159
+ * @generated from protobuf field: repeated MiLaboratories.Controller.Shared.uploadapi.GetPartURL.HTTPHeader headers = 3;
160
+ */
161
+ headers: uploadapi_GetPartURL_HTTPHeader[];
162
+ /**
163
+ * The number of the _first_ byte in the chunk.
164
+ * Absolute position from the start of the file ( file.seek(<chunk_start>, SEEK_START) ).
165
+ * The client is expected to send [<chunk_start>; <chunk_end>) range.
166
+ *
167
+ * @generated from protobuf field: uint64 chunk_start = 4;
168
+ */
169
+ chunkStart: bigint;
170
+ /**
171
+ * The number of the byte _after_ the last to be sent in the chunk.
172
+ * Absolute position from the start of the file.
173
+ * The client is expected to send [<chunk_start>; <chunk_end>) range.
174
+ *
175
+ * @generated from protobuf field: uint64 chunk_end = 5;
176
+ */
177
+ chunkEnd: bigint;
178
+ }
179
+ /**
180
+ * @generated from protobuf message MiLaboratories.Controller.Shared.uploadapi.Finalize
181
+ */
182
+ export interface uploadapi_Finalize {}
183
+ /**
184
+ * @generated from protobuf message MiLaboratories.Controller.Shared.uploadapi.Finalize.Request
185
+ */
186
+ export interface uploadapi_Finalize_Request {
187
+ /**
188
+ * @generated from protobuf field: uint64 resource_id = 1;
189
+ */
190
+ resourceId: bigint;
191
+ }
192
+ /**
193
+ * @generated from protobuf message MiLaboratories.Controller.Shared.uploadapi.Finalize.Response
194
+ */
195
+ export interface uploadapi_Finalize_Response {}
196
+ // @generated message type with reflection information, may provide speed optimized methods
197
+ class uploadapi$Type extends MessageType<uploadapi> {
198
+ constructor() {
199
+ super('MiLaboratories.Controller.Shared.uploadapi', []);
200
+ }
201
+ create(value?: PartialMessage<uploadapi>): uploadapi {
202
+ const message = globalThis.Object.create(this.messagePrototype!);
203
+ if (value !== undefined)
204
+ reflectionMergePartial<uploadapi>(this, message, value);
205
+ return message;
206
+ }
207
+ internalBinaryRead(
208
+ reader: IBinaryReader,
209
+ length: number,
210
+ options: BinaryReadOptions,
211
+ target?: uploadapi
212
+ ): uploadapi {
213
+ return target ?? this.create();
214
+ }
215
+ internalBinaryWrite(
216
+ message: uploadapi,
217
+ writer: IBinaryWriter,
218
+ options: BinaryWriteOptions
219
+ ): IBinaryWriter {
220
+ let u = options.writeUnknownFields;
221
+ if (u !== false)
222
+ (u == true ? UnknownFieldHandler.onWrite : u)(
223
+ this.typeName,
224
+ message,
225
+ writer
226
+ );
227
+ return writer;
228
+ }
229
+ }
230
+ /**
231
+ * @generated MessageType for protobuf message MiLaboratories.Controller.Shared.uploadapi
232
+ */
233
+ export const uploadapi = new uploadapi$Type();
234
+ // @generated message type with reflection information, may provide speed optimized methods
235
+ class uploadapi_Init$Type extends MessageType<uploadapi_Init> {
236
+ constructor() {
237
+ super('MiLaboratories.Controller.Shared.uploadapi.Init', []);
238
+ }
239
+ create(value?: PartialMessage<uploadapi_Init>): uploadapi_Init {
240
+ const message = globalThis.Object.create(this.messagePrototype!);
241
+ if (value !== undefined)
242
+ reflectionMergePartial<uploadapi_Init>(this, message, value);
243
+ return message;
244
+ }
245
+ internalBinaryRead(
246
+ reader: IBinaryReader,
247
+ length: number,
248
+ options: BinaryReadOptions,
249
+ target?: uploadapi_Init
250
+ ): uploadapi_Init {
251
+ return target ?? this.create();
252
+ }
253
+ internalBinaryWrite(
254
+ message: uploadapi_Init,
255
+ writer: IBinaryWriter,
256
+ options: BinaryWriteOptions
257
+ ): IBinaryWriter {
258
+ let u = options.writeUnknownFields;
259
+ if (u !== false)
260
+ (u == true ? UnknownFieldHandler.onWrite : u)(
261
+ this.typeName,
262
+ message,
263
+ writer
264
+ );
265
+ return writer;
266
+ }
267
+ }
268
+ /**
269
+ * @generated MessageType for protobuf message MiLaboratories.Controller.Shared.uploadapi.Init
270
+ */
271
+ export const uploadapi_Init = new uploadapi_Init$Type();
272
+ // @generated message type with reflection information, may provide speed optimized methods
273
+ class uploadapi_Init_Request$Type extends MessageType<uploadapi_Init_Request> {
274
+ constructor() {
275
+ super('MiLaboratories.Controller.Shared.uploadapi.Init.Request', [
276
+ {
277
+ no: 1,
278
+ name: 'resource_id',
279
+ kind: 'scalar',
280
+ T: 4 /*ScalarType.UINT64*/,
281
+ L: 0 /*LongType.BIGINT*/
282
+ }
283
+ ]);
284
+ }
285
+ create(
286
+ value?: PartialMessage<uploadapi_Init_Request>
287
+ ): uploadapi_Init_Request {
288
+ const message = globalThis.Object.create(this.messagePrototype!);
289
+ message.resourceId = 0n;
290
+ if (value !== undefined)
291
+ reflectionMergePartial<uploadapi_Init_Request>(this, message, value);
292
+ return message;
293
+ }
294
+ internalBinaryRead(
295
+ reader: IBinaryReader,
296
+ length: number,
297
+ options: BinaryReadOptions,
298
+ target?: uploadapi_Init_Request
299
+ ): uploadapi_Init_Request {
300
+ let message = target ?? this.create(),
301
+ end = reader.pos + length;
302
+ while (reader.pos < end) {
303
+ let [fieldNo, wireType] = reader.tag();
304
+ switch (fieldNo) {
305
+ case /* uint64 resource_id */ 1:
306
+ message.resourceId = reader.uint64().toBigInt();
307
+ break;
308
+ default:
309
+ let u = options.readUnknownField;
310
+ if (u === 'throw')
311
+ throw new globalThis.Error(
312
+ `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
313
+ );
314
+ let d = reader.skip(wireType);
315
+ if (u !== false)
316
+ (u === true ? UnknownFieldHandler.onRead : u)(
317
+ this.typeName,
318
+ message,
319
+ fieldNo,
320
+ wireType,
321
+ d
322
+ );
323
+ }
324
+ }
325
+ return message;
326
+ }
327
+ internalBinaryWrite(
328
+ message: uploadapi_Init_Request,
329
+ writer: IBinaryWriter,
330
+ options: BinaryWriteOptions
331
+ ): IBinaryWriter {
332
+ /* uint64 resource_id = 1; */
333
+ if (message.resourceId !== 0n)
334
+ writer.tag(1, WireType.Varint).uint64(message.resourceId);
335
+ let u = options.writeUnknownFields;
336
+ if (u !== false)
337
+ (u == true ? UnknownFieldHandler.onWrite : u)(
338
+ this.typeName,
339
+ message,
340
+ writer
341
+ );
342
+ return writer;
343
+ }
344
+ }
345
+ /**
346
+ * @generated MessageType for protobuf message MiLaboratories.Controller.Shared.uploadapi.Init.Request
347
+ */
348
+ export const uploadapi_Init_Request = new uploadapi_Init_Request$Type();
349
+ // @generated message type with reflection information, may provide speed optimized methods
350
+ class uploadapi_Init_Response$Type extends MessageType<uploadapi_Init_Response> {
351
+ constructor() {
352
+ super('MiLaboratories.Controller.Shared.uploadapi.Init.Response', [
353
+ {
354
+ no: 1,
355
+ name: 'parts_count',
356
+ kind: 'scalar',
357
+ T: 4 /*ScalarType.UINT64*/,
358
+ L: 0 /*LongType.BIGINT*/
359
+ },
360
+ {
361
+ no: 2,
362
+ name: 'uploaded_parts',
363
+ kind: 'scalar',
364
+ repeat: 1 /*RepeatType.PACKED*/,
365
+ T: 4 /*ScalarType.UINT64*/,
366
+ L: 0 /*LongType.BIGINT*/
367
+ }
368
+ ]);
369
+ }
370
+ create(
371
+ value?: PartialMessage<uploadapi_Init_Response>
372
+ ): uploadapi_Init_Response {
373
+ const message = globalThis.Object.create(this.messagePrototype!);
374
+ message.partsCount = 0n;
375
+ message.uploadedParts = [];
376
+ if (value !== undefined)
377
+ reflectionMergePartial<uploadapi_Init_Response>(this, message, value);
378
+ return message;
379
+ }
380
+ internalBinaryRead(
381
+ reader: IBinaryReader,
382
+ length: number,
383
+ options: BinaryReadOptions,
384
+ target?: uploadapi_Init_Response
385
+ ): uploadapi_Init_Response {
386
+ let message = target ?? this.create(),
387
+ end = reader.pos + length;
388
+ while (reader.pos < end) {
389
+ let [fieldNo, wireType] = reader.tag();
390
+ switch (fieldNo) {
391
+ case /* uint64 parts_count */ 1:
392
+ message.partsCount = reader.uint64().toBigInt();
393
+ break;
394
+ case /* repeated uint64 uploaded_parts */ 2:
395
+ if (wireType === WireType.LengthDelimited)
396
+ for (let e = reader.int32() + reader.pos; reader.pos < e; )
397
+ message.uploadedParts.push(reader.uint64().toBigInt());
398
+ else message.uploadedParts.push(reader.uint64().toBigInt());
399
+ break;
400
+ default:
401
+ let u = options.readUnknownField;
402
+ if (u === 'throw')
403
+ throw new globalThis.Error(
404
+ `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
405
+ );
406
+ let d = reader.skip(wireType);
407
+ if (u !== false)
408
+ (u === true ? UnknownFieldHandler.onRead : u)(
409
+ this.typeName,
410
+ message,
411
+ fieldNo,
412
+ wireType,
413
+ d
414
+ );
415
+ }
416
+ }
417
+ return message;
418
+ }
419
+ internalBinaryWrite(
420
+ message: uploadapi_Init_Response,
421
+ writer: IBinaryWriter,
422
+ options: BinaryWriteOptions
423
+ ): IBinaryWriter {
424
+ /* uint64 parts_count = 1; */
425
+ if (message.partsCount !== 0n)
426
+ writer.tag(1, WireType.Varint).uint64(message.partsCount);
427
+ /* repeated uint64 uploaded_parts = 2; */
428
+ if (message.uploadedParts.length) {
429
+ writer.tag(2, WireType.LengthDelimited).fork();
430
+ for (let i = 0; i < message.uploadedParts.length; i++)
431
+ writer.uint64(message.uploadedParts[i]);
432
+ writer.join();
433
+ }
434
+ let u = options.writeUnknownFields;
435
+ if (u !== false)
436
+ (u == true ? UnknownFieldHandler.onWrite : u)(
437
+ this.typeName,
438
+ message,
439
+ writer
440
+ );
441
+ return writer;
442
+ }
443
+ }
444
+ /**
445
+ * @generated MessageType for protobuf message MiLaboratories.Controller.Shared.uploadapi.Init.Response
446
+ */
447
+ export const uploadapi_Init_Response = new uploadapi_Init_Response$Type();
448
+ // @generated message type with reflection information, may provide speed optimized methods
449
+ class uploadapi_UpdateProgress$Type extends MessageType<uploadapi_UpdateProgress> {
450
+ constructor() {
451
+ super('MiLaboratories.Controller.Shared.uploadapi.UpdateProgress', []);
452
+ }
453
+ create(
454
+ value?: PartialMessage<uploadapi_UpdateProgress>
455
+ ): uploadapi_UpdateProgress {
456
+ const message = globalThis.Object.create(this.messagePrototype!);
457
+ if (value !== undefined)
458
+ reflectionMergePartial<uploadapi_UpdateProgress>(this, message, value);
459
+ return message;
460
+ }
461
+ internalBinaryRead(
462
+ reader: IBinaryReader,
463
+ length: number,
464
+ options: BinaryReadOptions,
465
+ target?: uploadapi_UpdateProgress
466
+ ): uploadapi_UpdateProgress {
467
+ return target ?? this.create();
468
+ }
469
+ internalBinaryWrite(
470
+ message: uploadapi_UpdateProgress,
471
+ writer: IBinaryWriter,
472
+ options: BinaryWriteOptions
473
+ ): IBinaryWriter {
474
+ let u = options.writeUnknownFields;
475
+ if (u !== false)
476
+ (u == true ? UnknownFieldHandler.onWrite : u)(
477
+ this.typeName,
478
+ message,
479
+ writer
480
+ );
481
+ return writer;
482
+ }
483
+ }
484
+ /**
485
+ * @generated MessageType for protobuf message MiLaboratories.Controller.Shared.uploadapi.UpdateProgress
486
+ */
487
+ export const uploadapi_UpdateProgress = new uploadapi_UpdateProgress$Type();
488
+ // @generated message type with reflection information, may provide speed optimized methods
489
+ class uploadapi_UpdateProgress_Request$Type extends MessageType<uploadapi_UpdateProgress_Request> {
490
+ constructor() {
491
+ super('MiLaboratories.Controller.Shared.uploadapi.UpdateProgress.Request', [
492
+ {
493
+ no: 1,
494
+ name: 'resource_id',
495
+ kind: 'scalar',
496
+ T: 4 /*ScalarType.UINT64*/,
497
+ L: 0 /*LongType.BIGINT*/
498
+ },
499
+ {
500
+ no: 2,
501
+ name: 'bytes_processed',
502
+ kind: 'scalar',
503
+ T: 3 /*ScalarType.INT64*/,
504
+ L: 0 /*LongType.BIGINT*/
505
+ }
506
+ ]);
507
+ }
508
+ create(
509
+ value?: PartialMessage<uploadapi_UpdateProgress_Request>
510
+ ): uploadapi_UpdateProgress_Request {
511
+ const message = globalThis.Object.create(this.messagePrototype!);
512
+ message.resourceId = 0n;
513
+ message.bytesProcessed = 0n;
514
+ if (value !== undefined)
515
+ reflectionMergePartial<uploadapi_UpdateProgress_Request>(
516
+ this,
517
+ message,
518
+ value
519
+ );
520
+ return message;
521
+ }
522
+ internalBinaryRead(
523
+ reader: IBinaryReader,
524
+ length: number,
525
+ options: BinaryReadOptions,
526
+ target?: uploadapi_UpdateProgress_Request
527
+ ): uploadapi_UpdateProgress_Request {
528
+ let message = target ?? this.create(),
529
+ end = reader.pos + length;
530
+ while (reader.pos < end) {
531
+ let [fieldNo, wireType] = reader.tag();
532
+ switch (fieldNo) {
533
+ case /* uint64 resource_id */ 1:
534
+ message.resourceId = reader.uint64().toBigInt();
535
+ break;
536
+ case /* int64 bytes_processed */ 2:
537
+ message.bytesProcessed = reader.int64().toBigInt();
538
+ break;
539
+ default:
540
+ let u = options.readUnknownField;
541
+ if (u === 'throw')
542
+ throw new globalThis.Error(
543
+ `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
544
+ );
545
+ let d = reader.skip(wireType);
546
+ if (u !== false)
547
+ (u === true ? UnknownFieldHandler.onRead : u)(
548
+ this.typeName,
549
+ message,
550
+ fieldNo,
551
+ wireType,
552
+ d
553
+ );
554
+ }
555
+ }
556
+ return message;
557
+ }
558
+ internalBinaryWrite(
559
+ message: uploadapi_UpdateProgress_Request,
560
+ writer: IBinaryWriter,
561
+ options: BinaryWriteOptions
562
+ ): IBinaryWriter {
563
+ /* uint64 resource_id = 1; */
564
+ if (message.resourceId !== 0n)
565
+ writer.tag(1, WireType.Varint).uint64(message.resourceId);
566
+ /* int64 bytes_processed = 2; */
567
+ if (message.bytesProcessed !== 0n)
568
+ writer.tag(2, WireType.Varint).int64(message.bytesProcessed);
569
+ let u = options.writeUnknownFields;
570
+ if (u !== false)
571
+ (u == true ? UnknownFieldHandler.onWrite : u)(
572
+ this.typeName,
573
+ message,
574
+ writer
575
+ );
576
+ return writer;
577
+ }
578
+ }
579
+ /**
580
+ * @generated MessageType for protobuf message MiLaboratories.Controller.Shared.uploadapi.UpdateProgress.Request
581
+ */
582
+ export const uploadapi_UpdateProgress_Request =
583
+ new uploadapi_UpdateProgress_Request$Type();
584
+ // @generated message type with reflection information, may provide speed optimized methods
585
+ class uploadapi_UpdateProgress_Response$Type extends MessageType<uploadapi_UpdateProgress_Response> {
586
+ constructor() {
587
+ super(
588
+ 'MiLaboratories.Controller.Shared.uploadapi.UpdateProgress.Response',
589
+ []
590
+ );
591
+ }
592
+ create(
593
+ value?: PartialMessage<uploadapi_UpdateProgress_Response>
594
+ ): uploadapi_UpdateProgress_Response {
595
+ const message = globalThis.Object.create(this.messagePrototype!);
596
+ if (value !== undefined)
597
+ reflectionMergePartial<uploadapi_UpdateProgress_Response>(
598
+ this,
599
+ message,
600
+ value
601
+ );
602
+ return message;
603
+ }
604
+ internalBinaryRead(
605
+ reader: IBinaryReader,
606
+ length: number,
607
+ options: BinaryReadOptions,
608
+ target?: uploadapi_UpdateProgress_Response
609
+ ): uploadapi_UpdateProgress_Response {
610
+ return target ?? this.create();
611
+ }
612
+ internalBinaryWrite(
613
+ message: uploadapi_UpdateProgress_Response,
614
+ writer: IBinaryWriter,
615
+ options: BinaryWriteOptions
616
+ ): IBinaryWriter {
617
+ let u = options.writeUnknownFields;
618
+ if (u !== false)
619
+ (u == true ? UnknownFieldHandler.onWrite : u)(
620
+ this.typeName,
621
+ message,
622
+ writer
623
+ );
624
+ return writer;
625
+ }
626
+ }
627
+ /**
628
+ * @generated MessageType for protobuf message MiLaboratories.Controller.Shared.uploadapi.UpdateProgress.Response
629
+ */
630
+ export const uploadapi_UpdateProgress_Response =
631
+ new uploadapi_UpdateProgress_Response$Type();
632
+ // @generated message type with reflection information, may provide speed optimized methods
633
+ class uploadapi_GetPartURL$Type extends MessageType<uploadapi_GetPartURL> {
634
+ constructor() {
635
+ super('MiLaboratories.Controller.Shared.uploadapi.GetPartURL', []);
636
+ }
637
+ create(value?: PartialMessage<uploadapi_GetPartURL>): uploadapi_GetPartURL {
638
+ const message = globalThis.Object.create(this.messagePrototype!);
639
+ if (value !== undefined)
640
+ reflectionMergePartial<uploadapi_GetPartURL>(this, message, value);
641
+ return message;
642
+ }
643
+ internalBinaryRead(
644
+ reader: IBinaryReader,
645
+ length: number,
646
+ options: BinaryReadOptions,
647
+ target?: uploadapi_GetPartURL
648
+ ): uploadapi_GetPartURL {
649
+ return target ?? this.create();
650
+ }
651
+ internalBinaryWrite(
652
+ message: uploadapi_GetPartURL,
653
+ writer: IBinaryWriter,
654
+ options: BinaryWriteOptions
655
+ ): IBinaryWriter {
656
+ let u = options.writeUnknownFields;
657
+ if (u !== false)
658
+ (u == true ? UnknownFieldHandler.onWrite : u)(
659
+ this.typeName,
660
+ message,
661
+ writer
662
+ );
663
+ return writer;
664
+ }
665
+ }
666
+ /**
667
+ * @generated MessageType for protobuf message MiLaboratories.Controller.Shared.uploadapi.GetPartURL
668
+ */
669
+ export const uploadapi_GetPartURL = new uploadapi_GetPartURL$Type();
670
+ // @generated message type with reflection information, may provide speed optimized methods
671
+ class uploadapi_GetPartURL_Request$Type extends MessageType<uploadapi_GetPartURL_Request> {
672
+ constructor() {
673
+ super('MiLaboratories.Controller.Shared.uploadapi.GetPartURL.Request', [
674
+ {
675
+ no: 1,
676
+ name: 'resource_id',
677
+ kind: 'scalar',
678
+ T: 4 /*ScalarType.UINT64*/,
679
+ L: 0 /*LongType.BIGINT*/
680
+ },
681
+ {
682
+ no: 2,
683
+ name: 'part_number',
684
+ kind: 'scalar',
685
+ T: 4 /*ScalarType.UINT64*/,
686
+ L: 0 /*LongType.BIGINT*/
687
+ },
688
+ {
689
+ no: 3,
690
+ name: 'uploaded_part_size',
691
+ kind: 'scalar',
692
+ T: 4 /*ScalarType.UINT64*/,
693
+ L: 0 /*LongType.BIGINT*/
694
+ }
695
+ ]);
696
+ }
697
+ create(
698
+ value?: PartialMessage<uploadapi_GetPartURL_Request>
699
+ ): uploadapi_GetPartURL_Request {
700
+ const message = globalThis.Object.create(this.messagePrototype!);
701
+ message.resourceId = 0n;
702
+ message.partNumber = 0n;
703
+ message.uploadedPartSize = 0n;
704
+ if (value !== undefined)
705
+ reflectionMergePartial<uploadapi_GetPartURL_Request>(
706
+ this,
707
+ message,
708
+ value
709
+ );
710
+ return message;
711
+ }
712
+ internalBinaryRead(
713
+ reader: IBinaryReader,
714
+ length: number,
715
+ options: BinaryReadOptions,
716
+ target?: uploadapi_GetPartURL_Request
717
+ ): uploadapi_GetPartURL_Request {
718
+ let message = target ?? this.create(),
719
+ end = reader.pos + length;
720
+ while (reader.pos < end) {
721
+ let [fieldNo, wireType] = reader.tag();
722
+ switch (fieldNo) {
723
+ case /* uint64 resource_id */ 1:
724
+ message.resourceId = reader.uint64().toBigInt();
725
+ break;
726
+ case /* uint64 part_number */ 2:
727
+ message.partNumber = reader.uint64().toBigInt();
728
+ break;
729
+ case /* uint64 uploaded_part_size */ 3:
730
+ message.uploadedPartSize = reader.uint64().toBigInt();
731
+ break;
732
+ default:
733
+ let u = options.readUnknownField;
734
+ if (u === 'throw')
735
+ throw new globalThis.Error(
736
+ `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
737
+ );
738
+ let d = reader.skip(wireType);
739
+ if (u !== false)
740
+ (u === true ? UnknownFieldHandler.onRead : u)(
741
+ this.typeName,
742
+ message,
743
+ fieldNo,
744
+ wireType,
745
+ d
746
+ );
747
+ }
748
+ }
749
+ return message;
750
+ }
751
+ internalBinaryWrite(
752
+ message: uploadapi_GetPartURL_Request,
753
+ writer: IBinaryWriter,
754
+ options: BinaryWriteOptions
755
+ ): IBinaryWriter {
756
+ /* uint64 resource_id = 1; */
757
+ if (message.resourceId !== 0n)
758
+ writer.tag(1, WireType.Varint).uint64(message.resourceId);
759
+ /* uint64 part_number = 2; */
760
+ if (message.partNumber !== 0n)
761
+ writer.tag(2, WireType.Varint).uint64(message.partNumber);
762
+ /* uint64 uploaded_part_size = 3; */
763
+ if (message.uploadedPartSize !== 0n)
764
+ writer.tag(3, WireType.Varint).uint64(message.uploadedPartSize);
765
+ let u = options.writeUnknownFields;
766
+ if (u !== false)
767
+ (u == true ? UnknownFieldHandler.onWrite : u)(
768
+ this.typeName,
769
+ message,
770
+ writer
771
+ );
772
+ return writer;
773
+ }
774
+ }
775
+ /**
776
+ * @generated MessageType for protobuf message MiLaboratories.Controller.Shared.uploadapi.GetPartURL.Request
777
+ */
778
+ export const uploadapi_GetPartURL_Request =
779
+ new uploadapi_GetPartURL_Request$Type();
780
+ // @generated message type with reflection information, may provide speed optimized methods
781
+ class uploadapi_GetPartURL_HTTPHeader$Type extends MessageType<uploadapi_GetPartURL_HTTPHeader> {
782
+ constructor() {
783
+ super('MiLaboratories.Controller.Shared.uploadapi.GetPartURL.HTTPHeader', [
784
+ {
785
+ no: 1,
786
+ name: 'Name',
787
+ kind: 'scalar',
788
+ jsonName: 'Name',
789
+ T: 9 /*ScalarType.STRING*/
790
+ },
791
+ {
792
+ no: 2,
793
+ name: 'Value',
794
+ kind: 'scalar',
795
+ jsonName: 'Value',
796
+ T: 9 /*ScalarType.STRING*/
797
+ }
798
+ ]);
799
+ }
800
+ create(
801
+ value?: PartialMessage<uploadapi_GetPartURL_HTTPHeader>
802
+ ): uploadapi_GetPartURL_HTTPHeader {
803
+ const message = globalThis.Object.create(this.messagePrototype!);
804
+ message.name = '';
805
+ message.value = '';
806
+ if (value !== undefined)
807
+ reflectionMergePartial<uploadapi_GetPartURL_HTTPHeader>(
808
+ this,
809
+ message,
810
+ value
811
+ );
812
+ return message;
813
+ }
814
+ internalBinaryRead(
815
+ reader: IBinaryReader,
816
+ length: number,
817
+ options: BinaryReadOptions,
818
+ target?: uploadapi_GetPartURL_HTTPHeader
819
+ ): uploadapi_GetPartURL_HTTPHeader {
820
+ let message = target ?? this.create(),
821
+ end = reader.pos + length;
822
+ while (reader.pos < end) {
823
+ let [fieldNo, wireType] = reader.tag();
824
+ switch (fieldNo) {
825
+ case /* string Name = 1 [json_name = "Name"];*/ 1:
826
+ message.name = reader.string();
827
+ break;
828
+ case /* string Value = 2 [json_name = "Value"];*/ 2:
829
+ message.value = reader.string();
830
+ break;
831
+ default:
832
+ let u = options.readUnknownField;
833
+ if (u === 'throw')
834
+ throw new globalThis.Error(
835
+ `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
836
+ );
837
+ let d = reader.skip(wireType);
838
+ if (u !== false)
839
+ (u === true ? UnknownFieldHandler.onRead : u)(
840
+ this.typeName,
841
+ message,
842
+ fieldNo,
843
+ wireType,
844
+ d
845
+ );
846
+ }
847
+ }
848
+ return message;
849
+ }
850
+ internalBinaryWrite(
851
+ message: uploadapi_GetPartURL_HTTPHeader,
852
+ writer: IBinaryWriter,
853
+ options: BinaryWriteOptions
854
+ ): IBinaryWriter {
855
+ /* string Name = 1 [json_name = "Name"]; */
856
+ if (message.name !== '')
857
+ writer.tag(1, WireType.LengthDelimited).string(message.name);
858
+ /* string Value = 2 [json_name = "Value"]; */
859
+ if (message.value !== '')
860
+ writer.tag(2, WireType.LengthDelimited).string(message.value);
861
+ let u = options.writeUnknownFields;
862
+ if (u !== false)
863
+ (u == true ? UnknownFieldHandler.onWrite : u)(
864
+ this.typeName,
865
+ message,
866
+ writer
867
+ );
868
+ return writer;
869
+ }
870
+ }
871
+ /**
872
+ * @generated MessageType for protobuf message MiLaboratories.Controller.Shared.uploadapi.GetPartURL.HTTPHeader
873
+ */
874
+ export const uploadapi_GetPartURL_HTTPHeader =
875
+ new uploadapi_GetPartURL_HTTPHeader$Type();
876
+ // @generated message type with reflection information, may provide speed optimized methods
877
+ class uploadapi_GetPartURL_Response$Type extends MessageType<uploadapi_GetPartURL_Response> {
878
+ constructor() {
879
+ super('MiLaboratories.Controller.Shared.uploadapi.GetPartURL.Response', [
880
+ { no: 1, name: 'upload_url', kind: 'scalar', T: 9 /*ScalarType.STRING*/ },
881
+ { no: 2, name: 'method', kind: 'scalar', T: 9 /*ScalarType.STRING*/ },
882
+ {
883
+ no: 3,
884
+ name: 'headers',
885
+ kind: 'message',
886
+ repeat: 1 /*RepeatType.PACKED*/,
887
+ T: () => uploadapi_GetPartURL_HTTPHeader
888
+ },
889
+ {
890
+ no: 4,
891
+ name: 'chunk_start',
892
+ kind: 'scalar',
893
+ T: 4 /*ScalarType.UINT64*/,
894
+ L: 0 /*LongType.BIGINT*/
895
+ },
896
+ {
897
+ no: 5,
898
+ name: 'chunk_end',
899
+ kind: 'scalar',
900
+ T: 4 /*ScalarType.UINT64*/,
901
+ L: 0 /*LongType.BIGINT*/
902
+ }
903
+ ]);
904
+ }
905
+ create(
906
+ value?: PartialMessage<uploadapi_GetPartURL_Response>
907
+ ): uploadapi_GetPartURL_Response {
908
+ const message = globalThis.Object.create(this.messagePrototype!);
909
+ message.uploadUrl = '';
910
+ message.method = '';
911
+ message.headers = [];
912
+ message.chunkStart = 0n;
913
+ message.chunkEnd = 0n;
914
+ if (value !== undefined)
915
+ reflectionMergePartial<uploadapi_GetPartURL_Response>(
916
+ this,
917
+ message,
918
+ value
919
+ );
920
+ return message;
921
+ }
922
+ internalBinaryRead(
923
+ reader: IBinaryReader,
924
+ length: number,
925
+ options: BinaryReadOptions,
926
+ target?: uploadapi_GetPartURL_Response
927
+ ): uploadapi_GetPartURL_Response {
928
+ let message = target ?? this.create(),
929
+ end = reader.pos + length;
930
+ while (reader.pos < end) {
931
+ let [fieldNo, wireType] = reader.tag();
932
+ switch (fieldNo) {
933
+ case /* string upload_url */ 1:
934
+ message.uploadUrl = reader.string();
935
+ break;
936
+ case /* string method */ 2:
937
+ message.method = reader.string();
938
+ break;
939
+ case /* repeated MiLaboratories.Controller.Shared.uploadapi.GetPartURL.HTTPHeader headers */ 3:
940
+ message.headers.push(
941
+ uploadapi_GetPartURL_HTTPHeader.internalBinaryRead(
942
+ reader,
943
+ reader.uint32(),
944
+ options
945
+ )
946
+ );
947
+ break;
948
+ case /* uint64 chunk_start */ 4:
949
+ message.chunkStart = reader.uint64().toBigInt();
950
+ break;
951
+ case /* uint64 chunk_end */ 5:
952
+ message.chunkEnd = reader.uint64().toBigInt();
953
+ break;
954
+ default:
955
+ let u = options.readUnknownField;
956
+ if (u === 'throw')
957
+ throw new globalThis.Error(
958
+ `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
959
+ );
960
+ let d = reader.skip(wireType);
961
+ if (u !== false)
962
+ (u === true ? UnknownFieldHandler.onRead : u)(
963
+ this.typeName,
964
+ message,
965
+ fieldNo,
966
+ wireType,
967
+ d
968
+ );
969
+ }
970
+ }
971
+ return message;
972
+ }
973
+ internalBinaryWrite(
974
+ message: uploadapi_GetPartURL_Response,
975
+ writer: IBinaryWriter,
976
+ options: BinaryWriteOptions
977
+ ): IBinaryWriter {
978
+ /* string upload_url = 1; */
979
+ if (message.uploadUrl !== '')
980
+ writer.tag(1, WireType.LengthDelimited).string(message.uploadUrl);
981
+ /* string method = 2; */
982
+ if (message.method !== '')
983
+ writer.tag(2, WireType.LengthDelimited).string(message.method);
984
+ /* repeated MiLaboratories.Controller.Shared.uploadapi.GetPartURL.HTTPHeader headers = 3; */
985
+ for (let i = 0; i < message.headers.length; i++)
986
+ uploadapi_GetPartURL_HTTPHeader
987
+ .internalBinaryWrite(
988
+ message.headers[i],
989
+ writer.tag(3, WireType.LengthDelimited).fork(),
990
+ options
991
+ )
992
+ .join();
993
+ /* uint64 chunk_start = 4; */
994
+ if (message.chunkStart !== 0n)
995
+ writer.tag(4, WireType.Varint).uint64(message.chunkStart);
996
+ /* uint64 chunk_end = 5; */
997
+ if (message.chunkEnd !== 0n)
998
+ writer.tag(5, WireType.Varint).uint64(message.chunkEnd);
999
+ let u = options.writeUnknownFields;
1000
+ if (u !== false)
1001
+ (u == true ? UnknownFieldHandler.onWrite : u)(
1002
+ this.typeName,
1003
+ message,
1004
+ writer
1005
+ );
1006
+ return writer;
1007
+ }
1008
+ }
1009
+ /**
1010
+ * @generated MessageType for protobuf message MiLaboratories.Controller.Shared.uploadapi.GetPartURL.Response
1011
+ */
1012
+ export const uploadapi_GetPartURL_Response =
1013
+ new uploadapi_GetPartURL_Response$Type();
1014
+ // @generated message type with reflection information, may provide speed optimized methods
1015
+ class uploadapi_Finalize$Type extends MessageType<uploadapi_Finalize> {
1016
+ constructor() {
1017
+ super('MiLaboratories.Controller.Shared.uploadapi.Finalize', []);
1018
+ }
1019
+ create(value?: PartialMessage<uploadapi_Finalize>): uploadapi_Finalize {
1020
+ const message = globalThis.Object.create(this.messagePrototype!);
1021
+ if (value !== undefined)
1022
+ reflectionMergePartial<uploadapi_Finalize>(this, message, value);
1023
+ return message;
1024
+ }
1025
+ internalBinaryRead(
1026
+ reader: IBinaryReader,
1027
+ length: number,
1028
+ options: BinaryReadOptions,
1029
+ target?: uploadapi_Finalize
1030
+ ): uploadapi_Finalize {
1031
+ return target ?? this.create();
1032
+ }
1033
+ internalBinaryWrite(
1034
+ message: uploadapi_Finalize,
1035
+ writer: IBinaryWriter,
1036
+ options: BinaryWriteOptions
1037
+ ): IBinaryWriter {
1038
+ let u = options.writeUnknownFields;
1039
+ if (u !== false)
1040
+ (u == true ? UnknownFieldHandler.onWrite : u)(
1041
+ this.typeName,
1042
+ message,
1043
+ writer
1044
+ );
1045
+ return writer;
1046
+ }
1047
+ }
1048
+ /**
1049
+ * @generated MessageType for protobuf message MiLaboratories.Controller.Shared.uploadapi.Finalize
1050
+ */
1051
+ export const uploadapi_Finalize = new uploadapi_Finalize$Type();
1052
+ // @generated message type with reflection information, may provide speed optimized methods
1053
+ class uploadapi_Finalize_Request$Type extends MessageType<uploadapi_Finalize_Request> {
1054
+ constructor() {
1055
+ super('MiLaboratories.Controller.Shared.uploadapi.Finalize.Request', [
1056
+ {
1057
+ no: 1,
1058
+ name: 'resource_id',
1059
+ kind: 'scalar',
1060
+ T: 4 /*ScalarType.UINT64*/,
1061
+ L: 0 /*LongType.BIGINT*/
1062
+ }
1063
+ ]);
1064
+ }
1065
+ create(
1066
+ value?: PartialMessage<uploadapi_Finalize_Request>
1067
+ ): uploadapi_Finalize_Request {
1068
+ const message = globalThis.Object.create(this.messagePrototype!);
1069
+ message.resourceId = 0n;
1070
+ if (value !== undefined)
1071
+ reflectionMergePartial<uploadapi_Finalize_Request>(this, message, value);
1072
+ return message;
1073
+ }
1074
+ internalBinaryRead(
1075
+ reader: IBinaryReader,
1076
+ length: number,
1077
+ options: BinaryReadOptions,
1078
+ target?: uploadapi_Finalize_Request
1079
+ ): uploadapi_Finalize_Request {
1080
+ let message = target ?? this.create(),
1081
+ end = reader.pos + length;
1082
+ while (reader.pos < end) {
1083
+ let [fieldNo, wireType] = reader.tag();
1084
+ switch (fieldNo) {
1085
+ case /* uint64 resource_id */ 1:
1086
+ message.resourceId = reader.uint64().toBigInt();
1087
+ break;
1088
+ default:
1089
+ let u = options.readUnknownField;
1090
+ if (u === 'throw')
1091
+ throw new globalThis.Error(
1092
+ `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
1093
+ );
1094
+ let d = reader.skip(wireType);
1095
+ if (u !== false)
1096
+ (u === true ? UnknownFieldHandler.onRead : u)(
1097
+ this.typeName,
1098
+ message,
1099
+ fieldNo,
1100
+ wireType,
1101
+ d
1102
+ );
1103
+ }
1104
+ }
1105
+ return message;
1106
+ }
1107
+ internalBinaryWrite(
1108
+ message: uploadapi_Finalize_Request,
1109
+ writer: IBinaryWriter,
1110
+ options: BinaryWriteOptions
1111
+ ): IBinaryWriter {
1112
+ /* uint64 resource_id = 1; */
1113
+ if (message.resourceId !== 0n)
1114
+ writer.tag(1, WireType.Varint).uint64(message.resourceId);
1115
+ let u = options.writeUnknownFields;
1116
+ if (u !== false)
1117
+ (u == true ? UnknownFieldHandler.onWrite : u)(
1118
+ this.typeName,
1119
+ message,
1120
+ writer
1121
+ );
1122
+ return writer;
1123
+ }
1124
+ }
1125
+ /**
1126
+ * @generated MessageType for protobuf message MiLaboratories.Controller.Shared.uploadapi.Finalize.Request
1127
+ */
1128
+ export const uploadapi_Finalize_Request = new uploadapi_Finalize_Request$Type();
1129
+ // @generated message type with reflection information, may provide speed optimized methods
1130
+ class uploadapi_Finalize_Response$Type extends MessageType<uploadapi_Finalize_Response> {
1131
+ constructor() {
1132
+ super('MiLaboratories.Controller.Shared.uploadapi.Finalize.Response', []);
1133
+ }
1134
+ create(
1135
+ value?: PartialMessage<uploadapi_Finalize_Response>
1136
+ ): uploadapi_Finalize_Response {
1137
+ const message = globalThis.Object.create(this.messagePrototype!);
1138
+ if (value !== undefined)
1139
+ reflectionMergePartial<uploadapi_Finalize_Response>(this, message, value);
1140
+ return message;
1141
+ }
1142
+ internalBinaryRead(
1143
+ reader: IBinaryReader,
1144
+ length: number,
1145
+ options: BinaryReadOptions,
1146
+ target?: uploadapi_Finalize_Response
1147
+ ): uploadapi_Finalize_Response {
1148
+ return target ?? this.create();
1149
+ }
1150
+ internalBinaryWrite(
1151
+ message: uploadapi_Finalize_Response,
1152
+ writer: IBinaryWriter,
1153
+ options: BinaryWriteOptions
1154
+ ): IBinaryWriter {
1155
+ let u = options.writeUnknownFields;
1156
+ if (u !== false)
1157
+ (u == true ? UnknownFieldHandler.onWrite : u)(
1158
+ this.typeName,
1159
+ message,
1160
+ writer
1161
+ );
1162
+ return writer;
1163
+ }
1164
+ }
1165
+ /**
1166
+ * @generated MessageType for protobuf message MiLaboratories.Controller.Shared.uploadapi.Finalize.Response
1167
+ */
1168
+ export const uploadapi_Finalize_Response =
1169
+ new uploadapi_Finalize_Response$Type();
1170
+ /**
1171
+ * @generated ServiceType for protobuf service MiLaboratories.Controller.Shared.Upload
1172
+ */
1173
+ export const Upload = new ServiceType(
1174
+ 'MiLaboratories.Controller.Shared.Upload',
1175
+ [
1176
+ {
1177
+ name: 'Init',
1178
+ options: {},
1179
+ I: uploadapi_Init_Request,
1180
+ O: uploadapi_Init_Response
1181
+ },
1182
+ {
1183
+ name: 'GetPartURL',
1184
+ options: {},
1185
+ I: uploadapi_GetPartURL_Request,
1186
+ O: uploadapi_GetPartURL_Response
1187
+ },
1188
+ {
1189
+ name: 'UpdateProgress',
1190
+ options: {},
1191
+ I: uploadapi_UpdateProgress_Request,
1192
+ O: uploadapi_UpdateProgress_Response
1193
+ },
1194
+ {
1195
+ name: 'Finalize',
1196
+ options: {},
1197
+ I: uploadapi_Finalize_Request,
1198
+ O: uploadapi_Finalize_Response
1199
+ }
1200
+ ]
1201
+ );