@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,503 @@
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/lsapi/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 { Timestamp } from '../../../../../../../google/protobuf/timestamp';
15
+ /**
16
+ * @generated from protobuf message MiLaboratories.Controller.Shared.LsAPI
17
+ */
18
+ export interface LsAPI {}
19
+ /**
20
+ * @generated from protobuf message MiLaboratories.Controller.Shared.LsAPI.ListItem
21
+ */
22
+ export interface LsAPI_ListItem {
23
+ /**
24
+ * name of the item in storage, without any prefixes
25
+ *
26
+ * @generated from protobuf field: string name = 1;
27
+ */
28
+ name: string;
29
+ /**
30
+ * size of item in bytes
31
+ * is always zero for directories (is_dir = true)
32
+ *
33
+ * @generated from protobuf field: uint64 size = 2;
34
+ */
35
+ size: bigint;
36
+ /**
37
+ * is_dir is true for item, that can have subitems.
38
+ *
39
+ * @generated from protobuf field: bool is_dir = 3;
40
+ */
41
+ isDir: boolean;
42
+ /**
43
+ * full_name is the name of item absolute to storage root.
44
+ * it is <directory> + <name>
45
+ * The <delimiter>, used in names, is storage-specific and is NOT guaranteed to be '/'.
46
+ *
47
+ * @generated from protobuf field: string full_name = 10;
48
+ */
49
+ fullName: string;
50
+ /**
51
+ * directory, the item is located in. The value here is always a prefix of name:
52
+ * name.HasPrefix(directory) is always true.
53
+ *
54
+ * @generated from protobuf field: string directory = 11;
55
+ */
56
+ directory: string;
57
+ /**
58
+ * last_modified keeps the item last modification timestamp
59
+ *
60
+ * @generated from protobuf field: google.protobuf.Timestamp last_modified = 12;
61
+ */
62
+ lastModified?: Timestamp;
63
+ /**
64
+ * version of item in storage.
65
+ * When storage supports versioning or provides checksums for the data stored,
66
+ * the <version> field keeps that data.
67
+ * If not - it keeps the any simple combination of item attributes, that helps to
68
+ * detect if the contents of item has changed, e.g. <size>+<mtime>.
69
+ * Anyway, client should not try to interpret this field, but should provide it to the Platform
70
+ * in operations with given item (like BlobImportInternal) to help Platform with deduplication.
71
+ *
72
+ * @generated from protobuf field: string version = 13;
73
+ */
74
+ version: string;
75
+ }
76
+ /**
77
+ * @generated from protobuf message MiLaboratories.Controller.Shared.LsAPI.List
78
+ */
79
+ export interface LsAPI_List {}
80
+ /**
81
+ * @generated from protobuf message MiLaboratories.Controller.Shared.LsAPI.List.Request
82
+ */
83
+ export interface LsAPI_List_Request {
84
+ /**
85
+ * resource_id of 'LS/<Storage>' resource
86
+ *
87
+ * @generated from protobuf field: uint64 resource_id = 1;
88
+ */
89
+ resourceId: bigint;
90
+ /**
91
+ * location to list, absolute to storage root. Only items, that have <full_name> starting
92
+ * from <location> are included into list response.
93
+ *
94
+ * @generated from protobuf field: string location = 2;
95
+ */
96
+ location: string;
97
+ }
98
+ /**
99
+ * @generated from protobuf message MiLaboratories.Controller.Shared.LsAPI.List.Response
100
+ */
101
+ export interface LsAPI_List_Response {
102
+ /**
103
+ * List of the full (absolute to storage root) names of items from storage.
104
+ * E.g., for 'fs' storage each name will consist of names of all directories, where the
105
+ * item is located, and the item name itself.
106
+ * The delimiter, used in names, is storage-specific and is NOT guaranteed to be '/'.
107
+ *
108
+ * @generated from protobuf field: repeated MiLaboratories.Controller.Shared.LsAPI.ListItem items = 1;
109
+ */
110
+ items: LsAPI_ListItem[];
111
+ /**
112
+ * delimiter is path separator, used in this storage. Client can use it to parse item names into parts,
113
+ * to extract directory names.
114
+ *
115
+ * @generated from protobuf field: string delimiter = 2;
116
+ */
117
+ delimiter: string;
118
+ }
119
+ // @generated message type with reflection information, may provide speed optimized methods
120
+ class LsAPI$Type extends MessageType<LsAPI> {
121
+ constructor() {
122
+ super('MiLaboratories.Controller.Shared.LsAPI', []);
123
+ }
124
+ create(value?: PartialMessage<LsAPI>): LsAPI {
125
+ const message = globalThis.Object.create(this.messagePrototype!);
126
+ if (value !== undefined)
127
+ reflectionMergePartial<LsAPI>(this, message, value);
128
+ return message;
129
+ }
130
+ internalBinaryRead(
131
+ reader: IBinaryReader,
132
+ length: number,
133
+ options: BinaryReadOptions,
134
+ target?: LsAPI
135
+ ): LsAPI {
136
+ return target ?? this.create();
137
+ }
138
+ internalBinaryWrite(
139
+ message: LsAPI,
140
+ writer: IBinaryWriter,
141
+ options: BinaryWriteOptions
142
+ ): IBinaryWriter {
143
+ let u = options.writeUnknownFields;
144
+ if (u !== false)
145
+ (u == true ? UnknownFieldHandler.onWrite : u)(
146
+ this.typeName,
147
+ message,
148
+ writer
149
+ );
150
+ return writer;
151
+ }
152
+ }
153
+ /**
154
+ * @generated MessageType for protobuf message MiLaboratories.Controller.Shared.LsAPI
155
+ */
156
+ export const LsAPI = new LsAPI$Type();
157
+ // @generated message type with reflection information, may provide speed optimized methods
158
+ class LsAPI_ListItem$Type extends MessageType<LsAPI_ListItem> {
159
+ constructor() {
160
+ super('MiLaboratories.Controller.Shared.LsAPI.ListItem', [
161
+ { no: 1, name: 'name', kind: 'scalar', T: 9 /*ScalarType.STRING*/ },
162
+ {
163
+ no: 2,
164
+ name: 'size',
165
+ kind: 'scalar',
166
+ T: 4 /*ScalarType.UINT64*/,
167
+ L: 0 /*LongType.BIGINT*/
168
+ },
169
+ { no: 3, name: 'is_dir', kind: 'scalar', T: 8 /*ScalarType.BOOL*/ },
170
+ { no: 10, name: 'full_name', kind: 'scalar', T: 9 /*ScalarType.STRING*/ },
171
+ { no: 11, name: 'directory', kind: 'scalar', T: 9 /*ScalarType.STRING*/ },
172
+ { no: 12, name: 'last_modified', kind: 'message', T: () => Timestamp },
173
+ { no: 13, name: 'version', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }
174
+ ]);
175
+ }
176
+ create(value?: PartialMessage<LsAPI_ListItem>): LsAPI_ListItem {
177
+ const message = globalThis.Object.create(this.messagePrototype!);
178
+ message.name = '';
179
+ message.size = 0n;
180
+ message.isDir = false;
181
+ message.fullName = '';
182
+ message.directory = '';
183
+ message.version = '';
184
+ if (value !== undefined)
185
+ reflectionMergePartial<LsAPI_ListItem>(this, message, value);
186
+ return message;
187
+ }
188
+ internalBinaryRead(
189
+ reader: IBinaryReader,
190
+ length: number,
191
+ options: BinaryReadOptions,
192
+ target?: LsAPI_ListItem
193
+ ): LsAPI_ListItem {
194
+ let message = target ?? this.create(),
195
+ end = reader.pos + length;
196
+ while (reader.pos < end) {
197
+ let [fieldNo, wireType] = reader.tag();
198
+ switch (fieldNo) {
199
+ case /* string name */ 1:
200
+ message.name = reader.string();
201
+ break;
202
+ case /* uint64 size */ 2:
203
+ message.size = reader.uint64().toBigInt();
204
+ break;
205
+ case /* bool is_dir */ 3:
206
+ message.isDir = reader.bool();
207
+ break;
208
+ case /* string full_name */ 10:
209
+ message.fullName = reader.string();
210
+ break;
211
+ case /* string directory */ 11:
212
+ message.directory = reader.string();
213
+ break;
214
+ case /* google.protobuf.Timestamp last_modified */ 12:
215
+ message.lastModified = Timestamp.internalBinaryRead(
216
+ reader,
217
+ reader.uint32(),
218
+ options,
219
+ message.lastModified
220
+ );
221
+ break;
222
+ case /* string version */ 13:
223
+ message.version = reader.string();
224
+ break;
225
+ default:
226
+ let u = options.readUnknownField;
227
+ if (u === 'throw')
228
+ throw new globalThis.Error(
229
+ `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
230
+ );
231
+ let d = reader.skip(wireType);
232
+ if (u !== false)
233
+ (u === true ? UnknownFieldHandler.onRead : u)(
234
+ this.typeName,
235
+ message,
236
+ fieldNo,
237
+ wireType,
238
+ d
239
+ );
240
+ }
241
+ }
242
+ return message;
243
+ }
244
+ internalBinaryWrite(
245
+ message: LsAPI_ListItem,
246
+ writer: IBinaryWriter,
247
+ options: BinaryWriteOptions
248
+ ): IBinaryWriter {
249
+ /* string name = 1; */
250
+ if (message.name !== '')
251
+ writer.tag(1, WireType.LengthDelimited).string(message.name);
252
+ /* uint64 size = 2; */
253
+ if (message.size !== 0n)
254
+ writer.tag(2, WireType.Varint).uint64(message.size);
255
+ /* bool is_dir = 3; */
256
+ if (message.isDir !== false)
257
+ writer.tag(3, WireType.Varint).bool(message.isDir);
258
+ /* string full_name = 10; */
259
+ if (message.fullName !== '')
260
+ writer.tag(10, WireType.LengthDelimited).string(message.fullName);
261
+ /* string directory = 11; */
262
+ if (message.directory !== '')
263
+ writer.tag(11, WireType.LengthDelimited).string(message.directory);
264
+ /* google.protobuf.Timestamp last_modified = 12; */
265
+ if (message.lastModified)
266
+ Timestamp.internalBinaryWrite(
267
+ message.lastModified,
268
+ writer.tag(12, WireType.LengthDelimited).fork(),
269
+ options
270
+ ).join();
271
+ /* string version = 13; */
272
+ if (message.version !== '')
273
+ writer.tag(13, WireType.LengthDelimited).string(message.version);
274
+ let u = options.writeUnknownFields;
275
+ if (u !== false)
276
+ (u == true ? UnknownFieldHandler.onWrite : u)(
277
+ this.typeName,
278
+ message,
279
+ writer
280
+ );
281
+ return writer;
282
+ }
283
+ }
284
+ /**
285
+ * @generated MessageType for protobuf message MiLaboratories.Controller.Shared.LsAPI.ListItem
286
+ */
287
+ export const LsAPI_ListItem = new LsAPI_ListItem$Type();
288
+ // @generated message type with reflection information, may provide speed optimized methods
289
+ class LsAPI_List$Type extends MessageType<LsAPI_List> {
290
+ constructor() {
291
+ super('MiLaboratories.Controller.Shared.LsAPI.List', []);
292
+ }
293
+ create(value?: PartialMessage<LsAPI_List>): LsAPI_List {
294
+ const message = globalThis.Object.create(this.messagePrototype!);
295
+ if (value !== undefined)
296
+ reflectionMergePartial<LsAPI_List>(this, message, value);
297
+ return message;
298
+ }
299
+ internalBinaryRead(
300
+ reader: IBinaryReader,
301
+ length: number,
302
+ options: BinaryReadOptions,
303
+ target?: LsAPI_List
304
+ ): LsAPI_List {
305
+ return target ?? this.create();
306
+ }
307
+ internalBinaryWrite(
308
+ message: LsAPI_List,
309
+ writer: IBinaryWriter,
310
+ options: BinaryWriteOptions
311
+ ): IBinaryWriter {
312
+ let u = options.writeUnknownFields;
313
+ if (u !== false)
314
+ (u == true ? UnknownFieldHandler.onWrite : u)(
315
+ this.typeName,
316
+ message,
317
+ writer
318
+ );
319
+ return writer;
320
+ }
321
+ }
322
+ /**
323
+ * @generated MessageType for protobuf message MiLaboratories.Controller.Shared.LsAPI.List
324
+ */
325
+ export const LsAPI_List = new LsAPI_List$Type();
326
+ // @generated message type with reflection information, may provide speed optimized methods
327
+ class LsAPI_List_Request$Type extends MessageType<LsAPI_List_Request> {
328
+ constructor() {
329
+ super('MiLaboratories.Controller.Shared.LsAPI.List.Request', [
330
+ {
331
+ no: 1,
332
+ name: 'resource_id',
333
+ kind: 'scalar',
334
+ T: 4 /*ScalarType.UINT64*/,
335
+ L: 0 /*LongType.BIGINT*/
336
+ },
337
+ { no: 2, name: 'location', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }
338
+ ]);
339
+ }
340
+ create(value?: PartialMessage<LsAPI_List_Request>): LsAPI_List_Request {
341
+ const message = globalThis.Object.create(this.messagePrototype!);
342
+ message.resourceId = 0n;
343
+ message.location = '';
344
+ if (value !== undefined)
345
+ reflectionMergePartial<LsAPI_List_Request>(this, message, value);
346
+ return message;
347
+ }
348
+ internalBinaryRead(
349
+ reader: IBinaryReader,
350
+ length: number,
351
+ options: BinaryReadOptions,
352
+ target?: LsAPI_List_Request
353
+ ): LsAPI_List_Request {
354
+ let message = target ?? this.create(),
355
+ end = reader.pos + length;
356
+ while (reader.pos < end) {
357
+ let [fieldNo, wireType] = reader.tag();
358
+ switch (fieldNo) {
359
+ case /* uint64 resource_id */ 1:
360
+ message.resourceId = reader.uint64().toBigInt();
361
+ break;
362
+ case /* string location */ 2:
363
+ message.location = reader.string();
364
+ break;
365
+ default:
366
+ let u = options.readUnknownField;
367
+ if (u === 'throw')
368
+ throw new globalThis.Error(
369
+ `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
370
+ );
371
+ let d = reader.skip(wireType);
372
+ if (u !== false)
373
+ (u === true ? UnknownFieldHandler.onRead : u)(
374
+ this.typeName,
375
+ message,
376
+ fieldNo,
377
+ wireType,
378
+ d
379
+ );
380
+ }
381
+ }
382
+ return message;
383
+ }
384
+ internalBinaryWrite(
385
+ message: LsAPI_List_Request,
386
+ writer: IBinaryWriter,
387
+ options: BinaryWriteOptions
388
+ ): IBinaryWriter {
389
+ /* uint64 resource_id = 1; */
390
+ if (message.resourceId !== 0n)
391
+ writer.tag(1, WireType.Varint).uint64(message.resourceId);
392
+ /* string location = 2; */
393
+ if (message.location !== '')
394
+ writer.tag(2, WireType.LengthDelimited).string(message.location);
395
+ let u = options.writeUnknownFields;
396
+ if (u !== false)
397
+ (u == true ? UnknownFieldHandler.onWrite : u)(
398
+ this.typeName,
399
+ message,
400
+ writer
401
+ );
402
+ return writer;
403
+ }
404
+ }
405
+ /**
406
+ * @generated MessageType for protobuf message MiLaboratories.Controller.Shared.LsAPI.List.Request
407
+ */
408
+ export const LsAPI_List_Request = new LsAPI_List_Request$Type();
409
+ // @generated message type with reflection information, may provide speed optimized methods
410
+ class LsAPI_List_Response$Type extends MessageType<LsAPI_List_Response> {
411
+ constructor() {
412
+ super('MiLaboratories.Controller.Shared.LsAPI.List.Response', [
413
+ {
414
+ no: 1,
415
+ name: 'items',
416
+ kind: 'message',
417
+ repeat: 1 /*RepeatType.PACKED*/,
418
+ T: () => LsAPI_ListItem
419
+ },
420
+ { no: 2, name: 'delimiter', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }
421
+ ]);
422
+ }
423
+ create(value?: PartialMessage<LsAPI_List_Response>): LsAPI_List_Response {
424
+ const message = globalThis.Object.create(this.messagePrototype!);
425
+ message.items = [];
426
+ message.delimiter = '';
427
+ if (value !== undefined)
428
+ reflectionMergePartial<LsAPI_List_Response>(this, message, value);
429
+ return message;
430
+ }
431
+ internalBinaryRead(
432
+ reader: IBinaryReader,
433
+ length: number,
434
+ options: BinaryReadOptions,
435
+ target?: LsAPI_List_Response
436
+ ): LsAPI_List_Response {
437
+ let message = target ?? this.create(),
438
+ end = reader.pos + length;
439
+ while (reader.pos < end) {
440
+ let [fieldNo, wireType] = reader.tag();
441
+ switch (fieldNo) {
442
+ case /* repeated MiLaboratories.Controller.Shared.LsAPI.ListItem items */ 1:
443
+ message.items.push(
444
+ LsAPI_ListItem.internalBinaryRead(reader, reader.uint32(), options)
445
+ );
446
+ break;
447
+ case /* string delimiter */ 2:
448
+ message.delimiter = reader.string();
449
+ break;
450
+ default:
451
+ let u = options.readUnknownField;
452
+ if (u === 'throw')
453
+ throw new globalThis.Error(
454
+ `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
455
+ );
456
+ let d = reader.skip(wireType);
457
+ if (u !== false)
458
+ (u === true ? UnknownFieldHandler.onRead : u)(
459
+ this.typeName,
460
+ message,
461
+ fieldNo,
462
+ wireType,
463
+ d
464
+ );
465
+ }
466
+ }
467
+ return message;
468
+ }
469
+ internalBinaryWrite(
470
+ message: LsAPI_List_Response,
471
+ writer: IBinaryWriter,
472
+ options: BinaryWriteOptions
473
+ ): IBinaryWriter {
474
+ /* repeated MiLaboratories.Controller.Shared.LsAPI.ListItem items = 1; */
475
+ for (let i = 0; i < message.items.length; i++)
476
+ LsAPI_ListItem.internalBinaryWrite(
477
+ message.items[i],
478
+ writer.tag(1, WireType.LengthDelimited).fork(),
479
+ options
480
+ ).join();
481
+ /* string delimiter = 2; */
482
+ if (message.delimiter !== '')
483
+ writer.tag(2, WireType.LengthDelimited).string(message.delimiter);
484
+ let u = options.writeUnknownFields;
485
+ if (u !== false)
486
+ (u == true ? UnknownFieldHandler.onWrite : u)(
487
+ this.typeName,
488
+ message,
489
+ writer
490
+ );
491
+ return writer;
492
+ }
493
+ }
494
+ /**
495
+ * @generated MessageType for protobuf message MiLaboratories.Controller.Shared.LsAPI.List.Response
496
+ */
497
+ export const LsAPI_List_Response = new LsAPI_List_Response$Type();
498
+ /**
499
+ * @generated ServiceType for protobuf service MiLaboratories.Controller.Shared.LS
500
+ */
501
+ export const LS = new ServiceType('MiLaboratories.Controller.Shared.LS', [
502
+ { name: 'List', options: {}, I: LsAPI_List_Request, O: LsAPI_List_Response }
503
+ ]);
@@ -0,0 +1,84 @@
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 type { RpcTransport } from '@protobuf-ts/runtime-rpc';
5
+ import type { ServiceInfo } from '@protobuf-ts/runtime-rpc';
6
+ import { Progress } from './protocol';
7
+ import type { ProgressAPI_RealtimeStatus_Response } from './protocol';
8
+ import type { ProgressAPI_RealtimeStatus_Request } from './protocol';
9
+ import type { ServerStreamingCall } from '@protobuf-ts/runtime-rpc';
10
+ import { stackIntercept } from '@protobuf-ts/runtime-rpc';
11
+ import type { ProgressAPI_GetStatus_Response } from './protocol';
12
+ import type { ProgressAPI_GetStatus_Request } from './protocol';
13
+ import type { UnaryCall } from '@protobuf-ts/runtime-rpc';
14
+ import type { RpcOptions } from '@protobuf-ts/runtime-rpc';
15
+ /**
16
+ *
17
+ * Progress provides access to progress of any long-running process associated with resource.
18
+ *
19
+ *
20
+ * @generated from protobuf service MiLaboratories.Controller.Shared.Progress
21
+ */
22
+ export interface IProgressClient {
23
+ /**
24
+ * @generated from protobuf rpc: GetStatus(MiLaboratories.Controller.Shared.ProgressAPI.GetStatus.Request) returns (MiLaboratories.Controller.Shared.ProgressAPI.GetStatus.Response);
25
+ */
26
+ getStatus(
27
+ input: ProgressAPI_GetStatus_Request,
28
+ options?: RpcOptions
29
+ ): UnaryCall<ProgressAPI_GetStatus_Request, ProgressAPI_GetStatus_Response>;
30
+ /**
31
+ * @generated from protobuf rpc: RealtimeStatus(MiLaboratories.Controller.Shared.ProgressAPI.RealtimeStatus.Request) returns (stream MiLaboratories.Controller.Shared.ProgressAPI.RealtimeStatus.Response);
32
+ */
33
+ realtimeStatus(
34
+ input: ProgressAPI_RealtimeStatus_Request,
35
+ options?: RpcOptions
36
+ ): ServerStreamingCall<
37
+ ProgressAPI_RealtimeStatus_Request,
38
+ ProgressAPI_RealtimeStatus_Response
39
+ >;
40
+ }
41
+ /**
42
+ *
43
+ * Progress provides access to progress of any long-running process associated with resource.
44
+ *
45
+ *
46
+ * @generated from protobuf service MiLaboratories.Controller.Shared.Progress
47
+ */
48
+ export class ProgressClient implements IProgressClient, ServiceInfo {
49
+ typeName = Progress.typeName;
50
+ methods = Progress.methods;
51
+ options = Progress.options;
52
+ constructor(private readonly _transport: RpcTransport) {}
53
+ /**
54
+ * @generated from protobuf rpc: GetStatus(MiLaboratories.Controller.Shared.ProgressAPI.GetStatus.Request) returns (MiLaboratories.Controller.Shared.ProgressAPI.GetStatus.Response);
55
+ */
56
+ getStatus(
57
+ input: ProgressAPI_GetStatus_Request,
58
+ options?: RpcOptions
59
+ ): UnaryCall<ProgressAPI_GetStatus_Request, ProgressAPI_GetStatus_Response> {
60
+ const method = this.methods[0],
61
+ opt = this._transport.mergeOptions(options);
62
+ return stackIntercept<
63
+ ProgressAPI_GetStatus_Request,
64
+ ProgressAPI_GetStatus_Response
65
+ >('unary', this._transport, method, opt, input);
66
+ }
67
+ /**
68
+ * @generated from protobuf rpc: RealtimeStatus(MiLaboratories.Controller.Shared.ProgressAPI.RealtimeStatus.Request) returns (stream MiLaboratories.Controller.Shared.ProgressAPI.RealtimeStatus.Response);
69
+ */
70
+ realtimeStatus(
71
+ input: ProgressAPI_RealtimeStatus_Request,
72
+ options?: RpcOptions
73
+ ): ServerStreamingCall<
74
+ ProgressAPI_RealtimeStatus_Request,
75
+ ProgressAPI_RealtimeStatus_Response
76
+ > {
77
+ const method = this.methods[1],
78
+ opt = this._transport.mergeOptions(options);
79
+ return stackIntercept<
80
+ ProgressAPI_RealtimeStatus_Request,
81
+ ProgressAPI_RealtimeStatus_Response
82
+ >('serverStreaming', this._transport, method, opt, input);
83
+ }
84
+ }