@alienplatform/bindings 1.0.0 → 2.0.0

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 (56) hide show
  1. package/LICENSE.md +105 -0
  2. package/README.md +59 -0
  3. package/dist/errors.d.ts +56 -0
  4. package/dist/errors.d.ts.map +1 -0
  5. package/dist/factories.d.ts +26 -0
  6. package/dist/factories.d.ts.map +1 -0
  7. package/dist/index.d.ts +19 -1768
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +23 -44772
  10. package/dist/loader.d.ts +171 -0
  11. package/dist/loader.d.ts.map +1 -0
  12. package/dist/loader.js +3712 -0
  13. package/dist/native.d.ts +41 -0
  14. package/dist/native.d.ts.map +1 -0
  15. package/dist/native.js +46 -0
  16. package/dist/types.d.ts +150 -0
  17. package/dist/types.d.ts.map +1 -0
  18. package/package.json +39 -21
  19. package/AGENTS.md +0 -70
  20. package/dist/index.js.map +0 -1
  21. package/scripts/generate-proto.sh +0 -46
  22. package/src/bindings/AGENTS.md +0 -105
  23. package/src/bindings/artifact-registry.ts +0 -314
  24. package/src/bindings/build.ts +0 -195
  25. package/src/bindings/function.ts +0 -164
  26. package/src/bindings/index.ts +0 -12
  27. package/src/bindings/kv.ts +0 -240
  28. package/src/bindings/queue.ts +0 -191
  29. package/src/bindings/service-account.ts +0 -113
  30. package/src/bindings/storage.ts +0 -535
  31. package/src/bindings/vault.ts +0 -133
  32. package/src/channel.ts +0 -94
  33. package/src/commands.ts +0 -76
  34. package/src/context.ts +0 -368
  35. package/src/errors.ts +0 -259
  36. package/src/events.ts +0 -463
  37. package/src/generated/artifact_registry.ts +0 -1934
  38. package/src/generated/build.ts +0 -1263
  39. package/src/generated/container.ts +0 -485
  40. package/src/generated/control.ts +0 -1574
  41. package/src/generated/function.ts +0 -741
  42. package/src/generated/google/protobuf/duration.ts +0 -196
  43. package/src/generated/google/protobuf/timestamp.ts +0 -225
  44. package/src/generated/kv.ts +0 -1137
  45. package/src/generated/queue.ts +0 -729
  46. package/src/generated/service_account.ts +0 -766
  47. package/src/generated/storage.ts +0 -3653
  48. package/src/generated/vault.ts +0 -519
  49. package/src/generated/wait_until.ts +0 -781
  50. package/src/global.ts +0 -316
  51. package/src/grpc-utils.ts +0 -159
  52. package/src/index.ts +0 -156
  53. package/src/types.ts +0 -384
  54. package/src/wait-until.ts +0 -257
  55. package/tsconfig.json +0 -8
  56. package/tsdown.config.ts +0 -14
@@ -1,3653 +0,0 @@
1
- // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
- // versions:
3
- // protoc-gen-ts_proto v2.10.1
4
- // protoc v5.29.3
5
- // source: storage.proto
6
-
7
- /* eslint-disable */
8
- import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
9
- import type { CallContext, CallOptions } from "nice-grpc-common";
10
- import { Timestamp } from "./google/protobuf/timestamp.js";
11
-
12
- export const protobufPackage = "alien_bindings.storage";
13
-
14
- /**
15
- * Defines the behavior for a put operation if the object already exists.
16
- * Maps to object_store::PutMode.
17
- */
18
- export enum StoragePutModeEnum {
19
- /**
20
- * PUT_MODE_OVERWRITE - Overwrites the object if it exists. This is the default behavior.
21
- * Maps to object_store::PutMode::Overwrite.
22
- */
23
- PUT_MODE_OVERWRITE = 0,
24
- /**
25
- * PUT_MODE_CREATE - Fails the operation if the object already exists.
26
- * Maps to object_store::PutMode::Create.
27
- */
28
- PUT_MODE_CREATE = 1,
29
- /**
30
- * PUT_MODE_UPDATE - Updates the object only if the provided version details match the existing object's version.
31
- * Requires `update_version_details` in `StoragePutOptions`.
32
- * Maps to object_store::PutMode::Update.
33
- */
34
- PUT_MODE_UPDATE = 2,
35
- UNRECOGNIZED = -1,
36
- }
37
-
38
- export function storagePutModeEnumFromJSON(object: any): StoragePutModeEnum {
39
- switch (object) {
40
- case 0:
41
- case "PUT_MODE_OVERWRITE":
42
- return StoragePutModeEnum.PUT_MODE_OVERWRITE;
43
- case 1:
44
- case "PUT_MODE_CREATE":
45
- return StoragePutModeEnum.PUT_MODE_CREATE;
46
- case 2:
47
- case "PUT_MODE_UPDATE":
48
- return StoragePutModeEnum.PUT_MODE_UPDATE;
49
- case -1:
50
- case "UNRECOGNIZED":
51
- default:
52
- return StoragePutModeEnum.UNRECOGNIZED;
53
- }
54
- }
55
-
56
- export function storagePutModeEnumToJSON(object: StoragePutModeEnum): string {
57
- switch (object) {
58
- case StoragePutModeEnum.PUT_MODE_OVERWRITE:
59
- return "PUT_MODE_OVERWRITE";
60
- case StoragePutModeEnum.PUT_MODE_CREATE:
61
- return "PUT_MODE_CREATE";
62
- case StoragePutModeEnum.PUT_MODE_UPDATE:
63
- return "PUT_MODE_UPDATE";
64
- case StoragePutModeEnum.UNRECOGNIZED:
65
- default:
66
- return "UNRECOGNIZED";
67
- }
68
- }
69
-
70
- /** HTTP method for signed URL requests. */
71
- export enum StorageHttpMethod {
72
- HTTP_METHOD_GET = 0,
73
- HTTP_METHOD_PUT = 1,
74
- HTTP_METHOD_POST = 2,
75
- HTTP_METHOD_DELETE = 3,
76
- HTTP_METHOD_HEAD = 4,
77
- UNRECOGNIZED = -1,
78
- }
79
-
80
- export function storageHttpMethodFromJSON(object: any): StorageHttpMethod {
81
- switch (object) {
82
- case 0:
83
- case "HTTP_METHOD_GET":
84
- return StorageHttpMethod.HTTP_METHOD_GET;
85
- case 1:
86
- case "HTTP_METHOD_PUT":
87
- return StorageHttpMethod.HTTP_METHOD_PUT;
88
- case 2:
89
- case "HTTP_METHOD_POST":
90
- return StorageHttpMethod.HTTP_METHOD_POST;
91
- case 3:
92
- case "HTTP_METHOD_DELETE":
93
- return StorageHttpMethod.HTTP_METHOD_DELETE;
94
- case 4:
95
- case "HTTP_METHOD_HEAD":
96
- return StorageHttpMethod.HTTP_METHOD_HEAD;
97
- case -1:
98
- case "UNRECOGNIZED":
99
- default:
100
- return StorageHttpMethod.UNRECOGNIZED;
101
- }
102
- }
103
-
104
- export function storageHttpMethodToJSON(object: StorageHttpMethod): string {
105
- switch (object) {
106
- case StorageHttpMethod.HTTP_METHOD_GET:
107
- return "HTTP_METHOD_GET";
108
- case StorageHttpMethod.HTTP_METHOD_PUT:
109
- return "HTTP_METHOD_PUT";
110
- case StorageHttpMethod.HTTP_METHOD_POST:
111
- return "HTTP_METHOD_POST";
112
- case StorageHttpMethod.HTTP_METHOD_DELETE:
113
- return "HTTP_METHOD_DELETE";
114
- case StorageHttpMethod.HTTP_METHOD_HEAD:
115
- return "HTTP_METHOD_HEAD";
116
- case StorageHttpMethod.UNRECOGNIZED:
117
- default:
118
- return "UNRECOGNIZED";
119
- }
120
- }
121
-
122
- /**
123
- * Represents a byte range for a get operation.
124
- * Maps to std::ops::Range<usize> within object_store::GetRange::Bounded.
125
- */
126
- export interface StorageRange {
127
- /**
128
- * Start of the range (inclusive), 0-indexed.
129
- * Maps to the start of std::ops::Range<usize>.
130
- */
131
- start: number;
132
- /**
133
- * End of the range (exclusive), 0-indexed.
134
- * Maps to the end of std::ops::Range<usize>.
135
- */
136
- end: number;
137
- }
138
-
139
- /** Specifies a range for a get operation, mapping to object_store::GetRange. */
140
- export interface StorageGetRangeOption {
141
- /**
142
- * A specific bounded range (e.g., bytes 0-99).
143
- * Corresponds to object_store::GetRange::Bounded(start..end).
144
- */
145
- bounded?:
146
- | StorageRange
147
- | undefined;
148
- /**
149
- * A range starting from an offset relative to the beginning of the object.
150
- * Corresponds to object_store::GetRange::Offset(offset).
151
- */
152
- offsetFromStart?:
153
- | number
154
- | undefined;
155
- /**
156
- * A range representing a suffix of the object with a specific length.
157
- * Corresponds to object_store::GetRange::Suffix(length).
158
- */
159
- suffixLength?: number | undefined;
160
- }
161
-
162
- /** Options for a get operation, mapping to object_store::GetOptions. */
163
- export interface StorageGetOptions {
164
- /**
165
- * Succeeds if the object's ETag matches this value.
166
- * Maps to object_store::GetOptions::if_match.
167
- */
168
- ifMatch?:
169
- | string
170
- | undefined;
171
- /**
172
- * Succeeds if the object's ETag does not match this value.
173
- * Maps to object_store::GetOptions::if_none_match.
174
- */
175
- ifNoneMatch?:
176
- | string
177
- | undefined;
178
- /**
179
- * Succeeds if the object has been modified since this timestamp.
180
- * Maps to object_store::GetOptions::if_modified_since.
181
- */
182
- ifModifiedSince?:
183
- | Date
184
- | undefined;
185
- /**
186
- * Succeeds if the object has not been modified since this timestamp.
187
- * Maps to object_store::GetOptions::if_unmodified_since.
188
- */
189
- ifUnmodifiedSince?:
190
- | Date
191
- | undefined;
192
- /**
193
- * Specifies a byte range to retrieve.
194
- * Maps to object_store::GetOptions::range.
195
- */
196
- range?:
197
- | StorageGetRangeOption
198
- | undefined;
199
- /**
200
- * Retrieves a specific version of the object, if versioning is supported.
201
- * Maps to object_store::GetOptions::version.
202
- */
203
- version?:
204
- | string
205
- | undefined;
206
- /**
207
- * If true, only metadata is fetched (like a HEAD request), not the content.
208
- * Maps to object_store::GetOptions::head.
209
- */
210
- head: boolean;
211
- }
212
-
213
- /**
214
- * Specifies version details (ETag and/or version ID) for conditional updates.
215
- * Maps to object_store::UpdateVersion.
216
- */
217
- export interface StorageUpdateVersion {
218
- /**
219
- * The ETag of the object version to update.
220
- * Maps to object_store::UpdateVersion::e_tag.
221
- */
222
- eTag?:
223
- | string
224
- | undefined;
225
- /**
226
- * The version ID of the object version to update.
227
- * Maps to object_store::UpdateVersion::version.
228
- */
229
- version?: string | undefined;
230
- }
231
-
232
- /**
233
- * Represents a single tag (key-value pair).
234
- * Maps to a key-value pair within object_store::TagSet.
235
- */
236
- export interface StorageTag {
237
- /** The tag key. */
238
- key: string;
239
- /** The tag value. */
240
- value: string;
241
- }
242
-
243
- /**
244
- * A collection of tags.
245
- * Maps to object_store::TagSet.
246
- */
247
- export interface StorageTagSet {
248
- /** List of tags. */
249
- tags: StorageTag[];
250
- }
251
-
252
- /**
253
- * Represents a key-value pair for an object attribute.
254
- * Used to construct an object_store::Attributes map.
255
- */
256
- export interface StorageAttributeKeyValuePair {
257
- /**
258
- * The attribute key.
259
- * Standard keys map to specific object_store::Attribute variants:
260
- * - "content-disposition" -> object_store::Attribute::ContentDisposition
261
- * - "content-encoding" -> object_store::Attribute::ContentEncoding
262
- * - "content-language" -> object_store::Attribute::ContentLanguage
263
- * - "content-type" -> object_store::Attribute::ContentType
264
- * - "cache-control" -> object_store::Attribute::CacheControl
265
- * User-defined metadata keys must be prefixed with "metadata:".
266
- * For example, "metadata:my_custom_key" will be mapped to
267
- * object_store::Attribute::Metadata("my_custom_key").
268
- */
269
- key: string;
270
- /**
271
- * The attribute value.
272
- * Maps to object_store::AttributeValue.
273
- */
274
- value: string;
275
- }
276
-
277
- /**
278
- * A collection of storage attributes.
279
- * Maps to object_store::Attributes.
280
- */
281
- export interface StorageAttributesMap {
282
- /** List of attribute key-value pairs. */
283
- pairs: StorageAttributeKeyValuePair[];
284
- }
285
-
286
- /**
287
- * Options for non-streaming put (put_opts).
288
- * Maps to object_store::PutOptions.
289
- */
290
- export interface StoragePutOptions {
291
- /**
292
- * Specifies the behavior if the object already exists or if a specific version should be updated.
293
- * Defaults to PUT_MODE_OVERWRITE.
294
- * Maps to object_store::PutOptions::mode.
295
- */
296
- mode: StoragePutModeEnum;
297
- /**
298
- * Details for conditional updates based on ETag or version.
299
- * Only used if mode is PUT_MODE_UPDATE.
300
- * Maps to the argument of object_store::PutMode::Update.
301
- */
302
- updateVersionDetails?:
303
- | StorageUpdateVersion
304
- | undefined;
305
- /**
306
- * A set of tags to associate with the object.
307
- * Maps to object_store::PutOptions::tags.
308
- */
309
- tags?:
310
- | StorageTagSet
311
- | undefined;
312
- /**
313
- * Additional object attributes (e.g., Content-Type, Cache-Control, custom metadata).
314
- * Maps to object_store::PutOptions::attributes.
315
- */
316
- attributes?: StorageAttributesMap | undefined;
317
- }
318
-
319
- /**
320
- * Options for streaming put (put_multipart_opts).
321
- * Maps to object_store::PutMultipartOpts.
322
- */
323
- export interface StoragePutMultipartOptions {
324
- /**
325
- * A set of tags to associate with the object during a multipart upload.
326
- * Maps to object_store::PutMultipartOpts::tags.
327
- */
328
- tags?:
329
- | StorageTagSet
330
- | undefined;
331
- /**
332
- * Additional object attributes (e.g., Content-Type, Cache-Control, custom metadata)
333
- * for a multipart upload. Maps to object_store::PutMultipartOpts::attributes.
334
- */
335
- attributes?: StorageAttributesMap | undefined;
336
- }
337
-
338
- /**
339
- * StorageGet (replaces old StorageGet)
340
- * Request for retrieving an object from storage.
341
- */
342
- export interface StorageGetRequest {
343
- /** Name of the storage binding to use. */
344
- bindingName: string;
345
- /**
346
- * Path to the object within the binding.
347
- * Maps to object_store::path::Path.
348
- */
349
- path: string;
350
- /**
351
- * Optional parameters for the get operation.
352
- * Maps to object_store::GetOptions.
353
- */
354
- options?: StorageGetOptions | undefined;
355
- }
356
-
357
- /** A chunk of data from a storage object stream. */
358
- export interface StorageChunkResponse {
359
- /**
360
- * Bytes of the object chunk.
361
- * Corresponds to Bytes from the object_store::GetResult stream.
362
- */
363
- chunkData: Uint8Array;
364
- }
365
-
366
- /** New message for Get RPC stream */
367
- export interface GetResponsePart {
368
- /** First message in the stream */
369
- metadata?:
370
- | StorageObjectMeta
371
- | undefined;
372
- /** Subsequent data chunks */
373
- chunkData?: Uint8Array | undefined;
374
- }
375
-
376
- /**
377
- * StoragePutMultipart (replaces old StoragePutStream)
378
- * A request part for a streaming multipart put operation.
379
- * Can be either metadata (first message) or a data chunk.
380
- */
381
- export interface StoragePutMultipartChunkRequest {
382
- /** Metadata for the streaming put, must be the first message in the stream. */
383
- metadata?:
384
- | StoragePutMultipartMetadata
385
- | undefined;
386
- /**
387
- * A chunk of the object's data for a part of the multipart upload.
388
- * Corresponds to data passed to object_store::MultipartUpload::put_part.
389
- */
390
- chunkData?: Uint8Array | undefined;
391
- }
392
-
393
- /** Metadata for a streaming multipart put operation. */
394
- export interface StoragePutMultipartMetadata {
395
- /** Name of the storage binding to use. */
396
- bindingName: string;
397
- /**
398
- * Path where the object will be stored.
399
- * Maps to object_store::path::Path.
400
- */
401
- path: string;
402
- /**
403
- * Optional parameters for the multipart put operation.
404
- * Maps to object_store::PutMultipartOpts.
405
- */
406
- options?: StoragePutMultipartOptions | undefined;
407
- }
408
-
409
- /**
410
- * Response for a put operation (both simple and streaming).
411
- * Maps to object_store::PutResult.
412
- */
413
- export interface StoragePutResponse {
414
- /**
415
- * The ETag of the uploaded object, if available.
416
- * Maps to object_store::PutResult::e_tag.
417
- */
418
- eTag?:
419
- | string
420
- | undefined;
421
- /**
422
- * The version ID of the uploaded object, if versioning is supported and available.
423
- * Maps to object_store::PutResult::version.
424
- */
425
- version?: string | undefined;
426
- }
427
-
428
- /**
429
- * StoragePut (replaces old StoragePutSimple)
430
- * Request for uploading an object in a single message.
431
- */
432
- export interface StoragePutRequest {
433
- /** Name of the storage binding to use. */
434
- bindingName: string;
435
- /**
436
- * Path where the object will be stored.
437
- * Maps to object_store::path::Path.
438
- */
439
- path: string;
440
- /**
441
- * The entire object data.
442
- * Maps to object_store::PutPayload.
443
- */
444
- data: Uint8Array;
445
- /**
446
- * Optional parameters for the put operation.
447
- * Maps to object_store::PutOptions.
448
- */
449
- options?: StoragePutOptions | undefined;
450
- }
451
-
452
- /**
453
- * StorageDelete
454
- * Request for deleting an object from storage.
455
- */
456
- export interface StorageDeleteRequest {
457
- /** Name of the storage binding to use. */
458
- bindingName: string;
459
- /**
460
- * Path to the object to delete.
461
- * Maps to object_store::path::Path.
462
- */
463
- path: string;
464
- }
465
-
466
- /** Generic response for operations that don't return specific data on success (e.g., Delete, Copy, Rename). */
467
- export interface StorageOperationResponse {
468
- }
469
-
470
- /**
471
- * StorageList
472
- * Request for listing objects in a storage binding.
473
- */
474
- export interface StorageListRequest {
475
- /** Name of the storage binding to use. */
476
- bindingName: string;
477
- /**
478
- * Optional prefix to filter listed objects. Only objects whose paths start with this prefix will be returned.
479
- * Maps to the `prefix` argument in object_store::ObjectStore::list.
480
- */
481
- prefix?:
482
- | string
483
- | undefined;
484
- /**
485
- * Optional offset for pagination. If provided, listing will start after this object path.
486
- * Maps to the `offset` argument in object_store::ObjectStore::list_with_offset.
487
- */
488
- offset?: string | undefined;
489
- }
490
-
491
- /**
492
- * Metadata for a single object in storage.
493
- * Maps to object_store::ObjectMeta.
494
- */
495
- export interface StorageObjectMeta {
496
- /**
497
- * The full path (location) of the object.
498
- * Maps to object_store::ObjectMeta::location.
499
- */
500
- location: string;
501
- /**
502
- * Timestamp of the last modification.
503
- * Maps to object_store::ObjectMeta::last_modified.
504
- */
505
- lastModified:
506
- | Date
507
- | undefined;
508
- /**
509
- * Size of the object in bytes.
510
- * Maps to object_store::ObjectMeta::size.
511
- */
512
- size: number;
513
- /**
514
- * The ETag of the object, if available.
515
- * Maps to object_store::ObjectMeta::e_tag.
516
- */
517
- eTag?:
518
- | string
519
- | undefined;
520
- /**
521
- * The version ID of the object, if versioning is supported and available.
522
- * Maps to object_store::ObjectMeta::version.
523
- */
524
- version?: string | undefined;
525
- }
526
-
527
- /**
528
- * StorageListWithDelimiter
529
- * Request for listing objects and common prefixes (simulating directories).
530
- */
531
- export interface StorageListWithDelimiterRequest {
532
- /** Name of the storage binding to use. */
533
- bindingName: string;
534
- /**
535
- * Optional prefix to filter listed objects and common prefixes.
536
- * Maps to the `prefix` argument in object_store::ObjectStore::list_with_delimiter.
537
- */
538
- prefix?: string | undefined;
539
- }
540
-
541
- /**
542
- * Result of a list operation with a delimiter.
543
- * Maps to object_store::ListResult.
544
- */
545
- export interface StorageListResultProto {
546
- /**
547
- * List of common prefixes (simulating directories) found under the specified prefix.
548
- * Maps to object_store::ListResult::common_prefixes.
549
- */
550
- commonPrefixes: string[];
551
- /**
552
- * List of object metadata found under the specified prefix (excluding those within common_prefixes).
553
- * Maps to object_store::ListResult::objects.
554
- */
555
- objects: StorageObjectMeta[];
556
- }
557
-
558
- /**
559
- * StorageHead
560
- * Request for retrieving metadata of an object.
561
- */
562
- export interface StorageHeadRequest {
563
- /** Name of the storage binding to use. */
564
- bindingName: string;
565
- /**
566
- * Path to the object.
567
- * Maps to object_store::path::Path.
568
- */
569
- path: string;
570
- }
571
-
572
- /**
573
- * StorageGetBaseDir
574
- * Request for getting the base directory of a storage binding. (Alien specific)
575
- */
576
- export interface StorageGetBaseDirRequest {
577
- /** Name of the storage binding. */
578
- bindingName: string;
579
- }
580
-
581
- /** Response containing the base directory path. (Alien specific) */
582
- export interface StorageGetBaseDirResponse {
583
- /** The base directory path. */
584
- path: string;
585
- }
586
-
587
- /**
588
- * StorageGetUrl
589
- * Request for getting the underlying URL of a storage binding. (Alien specific)
590
- */
591
- export interface StorageGetUrlRequest {
592
- /** Name of the storage binding. */
593
- bindingName: string;
594
- }
595
-
596
- /** Response containing the URL. (Alien specific) */
597
- export interface StorageGetUrlResponse {
598
- /** The underlying URL. */
599
- url: string;
600
- }
601
-
602
- /**
603
- * StorageCopy & StorageRename
604
- * Request for copying an object.
605
- */
606
- export interface StorageCopyRequest {
607
- /** Name of the storage binding to use (operation is within the same binding). */
608
- bindingName: string;
609
- /**
610
- * Path of the source object.
611
- * Maps to object_store::path::Path.
612
- */
613
- fromPath: string;
614
- /**
615
- * Path of the destination object.
616
- * Maps to object_store::path::Path.
617
- */
618
- toPath: string;
619
- }
620
-
621
- /** Request for renaming (moving) an object. */
622
- export interface StorageRenameRequest {
623
- /** Name of the storage binding to use (operation is within the same binding). */
624
- bindingName: string;
625
- /**
626
- * Path of the source object.
627
- * Maps to object_store::path::Path.
628
- */
629
- fromPath: string;
630
- /**
631
- * Path of the destination object.
632
- * Maps to object_store::path::Path.
633
- */
634
- toPath: string;
635
- }
636
-
637
- /**
638
- * StorageSignedUrlRequest
639
- * Request for generating a signed URL for an object.
640
- */
641
- export interface StorageSignedUrlRequest {
642
- /** Name of the storage binding to use. */
643
- bindingName: string;
644
- /**
645
- * Path to the object within the binding.
646
- * Maps to object_store::path::Path.
647
- */
648
- path: string;
649
- /** HTTP method for the signed URL. */
650
- httpMethod: StorageHttpMethod;
651
- /** Expiration time for the signed URL. */
652
- expirationTime: Date | undefined;
653
- }
654
-
655
- /**
656
- * StorageSignedUrlResponse
657
- * Response containing the generated signed URL.
658
- */
659
- export interface StorageSignedUrlResponse {
660
- /** The generated signed URL. */
661
- url: string;
662
- }
663
-
664
- function createBaseStorageRange(): StorageRange {
665
- return { start: 0, end: 0 };
666
- }
667
-
668
- export const StorageRange: MessageFns<StorageRange> = {
669
- encode(message: StorageRange, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
670
- if (message.start !== 0) {
671
- writer.uint32(8).uint64(message.start);
672
- }
673
- if (message.end !== 0) {
674
- writer.uint32(16).uint64(message.end);
675
- }
676
- return writer;
677
- },
678
-
679
- decode(input: BinaryReader | Uint8Array, length?: number): StorageRange {
680
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
681
- const end = length === undefined ? reader.len : reader.pos + length;
682
- const message = createBaseStorageRange();
683
- while (reader.pos < end) {
684
- const tag = reader.uint32();
685
- switch (tag >>> 3) {
686
- case 1: {
687
- if (tag !== 8) {
688
- break;
689
- }
690
-
691
- message.start = longToNumber(reader.uint64());
692
- continue;
693
- }
694
- case 2: {
695
- if (tag !== 16) {
696
- break;
697
- }
698
-
699
- message.end = longToNumber(reader.uint64());
700
- continue;
701
- }
702
- }
703
- if ((tag & 7) === 4 || tag === 0) {
704
- break;
705
- }
706
- reader.skip(tag & 7);
707
- }
708
- return message;
709
- },
710
-
711
- fromJSON(object: any): StorageRange {
712
- return {
713
- start: isSet(object.start) ? globalThis.Number(object.start) : 0,
714
- end: isSet(object.end) ? globalThis.Number(object.end) : 0,
715
- };
716
- },
717
-
718
- toJSON(message: StorageRange): unknown {
719
- const obj: any = {};
720
- if (message.start !== 0) {
721
- obj.start = Math.round(message.start);
722
- }
723
- if (message.end !== 0) {
724
- obj.end = Math.round(message.end);
725
- }
726
- return obj;
727
- },
728
-
729
- create(base?: DeepPartial<StorageRange>): StorageRange {
730
- return StorageRange.fromPartial(base ?? {});
731
- },
732
- fromPartial(object: DeepPartial<StorageRange>): StorageRange {
733
- const message = createBaseStorageRange();
734
- message.start = object.start ?? 0;
735
- message.end = object.end ?? 0;
736
- return message;
737
- },
738
- };
739
-
740
- function createBaseStorageGetRangeOption(): StorageGetRangeOption {
741
- return { bounded: undefined, offsetFromStart: undefined, suffixLength: undefined };
742
- }
743
-
744
- export const StorageGetRangeOption: MessageFns<StorageGetRangeOption> = {
745
- encode(message: StorageGetRangeOption, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
746
- if (message.bounded !== undefined) {
747
- StorageRange.encode(message.bounded, writer.uint32(10).fork()).join();
748
- }
749
- if (message.offsetFromStart !== undefined) {
750
- writer.uint32(16).uint64(message.offsetFromStart);
751
- }
752
- if (message.suffixLength !== undefined) {
753
- writer.uint32(24).uint64(message.suffixLength);
754
- }
755
- return writer;
756
- },
757
-
758
- decode(input: BinaryReader | Uint8Array, length?: number): StorageGetRangeOption {
759
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
760
- const end = length === undefined ? reader.len : reader.pos + length;
761
- const message = createBaseStorageGetRangeOption();
762
- while (reader.pos < end) {
763
- const tag = reader.uint32();
764
- switch (tag >>> 3) {
765
- case 1: {
766
- if (tag !== 10) {
767
- break;
768
- }
769
-
770
- message.bounded = StorageRange.decode(reader, reader.uint32());
771
- continue;
772
- }
773
- case 2: {
774
- if (tag !== 16) {
775
- break;
776
- }
777
-
778
- message.offsetFromStart = longToNumber(reader.uint64());
779
- continue;
780
- }
781
- case 3: {
782
- if (tag !== 24) {
783
- break;
784
- }
785
-
786
- message.suffixLength = longToNumber(reader.uint64());
787
- continue;
788
- }
789
- }
790
- if ((tag & 7) === 4 || tag === 0) {
791
- break;
792
- }
793
- reader.skip(tag & 7);
794
- }
795
- return message;
796
- },
797
-
798
- fromJSON(object: any): StorageGetRangeOption {
799
- return {
800
- bounded: isSet(object.bounded) ? StorageRange.fromJSON(object.bounded) : undefined,
801
- offsetFromStart: isSet(object.offsetFromStart) ? globalThis.Number(object.offsetFromStart) : undefined,
802
- suffixLength: isSet(object.suffixLength) ? globalThis.Number(object.suffixLength) : undefined,
803
- };
804
- },
805
-
806
- toJSON(message: StorageGetRangeOption): unknown {
807
- const obj: any = {};
808
- if (message.bounded !== undefined) {
809
- obj.bounded = StorageRange.toJSON(message.bounded);
810
- }
811
- if (message.offsetFromStart !== undefined) {
812
- obj.offsetFromStart = Math.round(message.offsetFromStart);
813
- }
814
- if (message.suffixLength !== undefined) {
815
- obj.suffixLength = Math.round(message.suffixLength);
816
- }
817
- return obj;
818
- },
819
-
820
- create(base?: DeepPartial<StorageGetRangeOption>): StorageGetRangeOption {
821
- return StorageGetRangeOption.fromPartial(base ?? {});
822
- },
823
- fromPartial(object: DeepPartial<StorageGetRangeOption>): StorageGetRangeOption {
824
- const message = createBaseStorageGetRangeOption();
825
- message.bounded = (object.bounded !== undefined && object.bounded !== null)
826
- ? StorageRange.fromPartial(object.bounded)
827
- : undefined;
828
- message.offsetFromStart = object.offsetFromStart ?? undefined;
829
- message.suffixLength = object.suffixLength ?? undefined;
830
- return message;
831
- },
832
- };
833
-
834
- function createBaseStorageGetOptions(): StorageGetOptions {
835
- return {
836
- ifMatch: undefined,
837
- ifNoneMatch: undefined,
838
- ifModifiedSince: undefined,
839
- ifUnmodifiedSince: undefined,
840
- range: undefined,
841
- version: undefined,
842
- head: false,
843
- };
844
- }
845
-
846
- export const StorageGetOptions: MessageFns<StorageGetOptions> = {
847
- encode(message: StorageGetOptions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
848
- if (message.ifMatch !== undefined) {
849
- writer.uint32(10).string(message.ifMatch);
850
- }
851
- if (message.ifNoneMatch !== undefined) {
852
- writer.uint32(18).string(message.ifNoneMatch);
853
- }
854
- if (message.ifModifiedSince !== undefined) {
855
- Timestamp.encode(toTimestamp(message.ifModifiedSince), writer.uint32(26).fork()).join();
856
- }
857
- if (message.ifUnmodifiedSince !== undefined) {
858
- Timestamp.encode(toTimestamp(message.ifUnmodifiedSince), writer.uint32(34).fork()).join();
859
- }
860
- if (message.range !== undefined) {
861
- StorageGetRangeOption.encode(message.range, writer.uint32(42).fork()).join();
862
- }
863
- if (message.version !== undefined) {
864
- writer.uint32(50).string(message.version);
865
- }
866
- if (message.head !== false) {
867
- writer.uint32(56).bool(message.head);
868
- }
869
- return writer;
870
- },
871
-
872
- decode(input: BinaryReader | Uint8Array, length?: number): StorageGetOptions {
873
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
874
- const end = length === undefined ? reader.len : reader.pos + length;
875
- const message = createBaseStorageGetOptions();
876
- while (reader.pos < end) {
877
- const tag = reader.uint32();
878
- switch (tag >>> 3) {
879
- case 1: {
880
- if (tag !== 10) {
881
- break;
882
- }
883
-
884
- message.ifMatch = reader.string();
885
- continue;
886
- }
887
- case 2: {
888
- if (tag !== 18) {
889
- break;
890
- }
891
-
892
- message.ifNoneMatch = reader.string();
893
- continue;
894
- }
895
- case 3: {
896
- if (tag !== 26) {
897
- break;
898
- }
899
-
900
- message.ifModifiedSince = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
901
- continue;
902
- }
903
- case 4: {
904
- if (tag !== 34) {
905
- break;
906
- }
907
-
908
- message.ifUnmodifiedSince = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
909
- continue;
910
- }
911
- case 5: {
912
- if (tag !== 42) {
913
- break;
914
- }
915
-
916
- message.range = StorageGetRangeOption.decode(reader, reader.uint32());
917
- continue;
918
- }
919
- case 6: {
920
- if (tag !== 50) {
921
- break;
922
- }
923
-
924
- message.version = reader.string();
925
- continue;
926
- }
927
- case 7: {
928
- if (tag !== 56) {
929
- break;
930
- }
931
-
932
- message.head = reader.bool();
933
- continue;
934
- }
935
- }
936
- if ((tag & 7) === 4 || tag === 0) {
937
- break;
938
- }
939
- reader.skip(tag & 7);
940
- }
941
- return message;
942
- },
943
-
944
- fromJSON(object: any): StorageGetOptions {
945
- return {
946
- ifMatch: isSet(object.ifMatch) ? globalThis.String(object.ifMatch) : undefined,
947
- ifNoneMatch: isSet(object.ifNoneMatch) ? globalThis.String(object.ifNoneMatch) : undefined,
948
- ifModifiedSince: isSet(object.ifModifiedSince) ? fromJsonTimestamp(object.ifModifiedSince) : undefined,
949
- ifUnmodifiedSince: isSet(object.ifUnmodifiedSince) ? fromJsonTimestamp(object.ifUnmodifiedSince) : undefined,
950
- range: isSet(object.range) ? StorageGetRangeOption.fromJSON(object.range) : undefined,
951
- version: isSet(object.version) ? globalThis.String(object.version) : undefined,
952
- head: isSet(object.head) ? globalThis.Boolean(object.head) : false,
953
- };
954
- },
955
-
956
- toJSON(message: StorageGetOptions): unknown {
957
- const obj: any = {};
958
- if (message.ifMatch !== undefined) {
959
- obj.ifMatch = message.ifMatch;
960
- }
961
- if (message.ifNoneMatch !== undefined) {
962
- obj.ifNoneMatch = message.ifNoneMatch;
963
- }
964
- if (message.ifModifiedSince !== undefined) {
965
- obj.ifModifiedSince = message.ifModifiedSince.toISOString();
966
- }
967
- if (message.ifUnmodifiedSince !== undefined) {
968
- obj.ifUnmodifiedSince = message.ifUnmodifiedSince.toISOString();
969
- }
970
- if (message.range !== undefined) {
971
- obj.range = StorageGetRangeOption.toJSON(message.range);
972
- }
973
- if (message.version !== undefined) {
974
- obj.version = message.version;
975
- }
976
- if (message.head !== false) {
977
- obj.head = message.head;
978
- }
979
- return obj;
980
- },
981
-
982
- create(base?: DeepPartial<StorageGetOptions>): StorageGetOptions {
983
- return StorageGetOptions.fromPartial(base ?? {});
984
- },
985
- fromPartial(object: DeepPartial<StorageGetOptions>): StorageGetOptions {
986
- const message = createBaseStorageGetOptions();
987
- message.ifMatch = object.ifMatch ?? undefined;
988
- message.ifNoneMatch = object.ifNoneMatch ?? undefined;
989
- message.ifModifiedSince = object.ifModifiedSince ?? undefined;
990
- message.ifUnmodifiedSince = object.ifUnmodifiedSince ?? undefined;
991
- message.range = (object.range !== undefined && object.range !== null)
992
- ? StorageGetRangeOption.fromPartial(object.range)
993
- : undefined;
994
- message.version = object.version ?? undefined;
995
- message.head = object.head ?? false;
996
- return message;
997
- },
998
- };
999
-
1000
- function createBaseStorageUpdateVersion(): StorageUpdateVersion {
1001
- return { eTag: undefined, version: undefined };
1002
- }
1003
-
1004
- export const StorageUpdateVersion: MessageFns<StorageUpdateVersion> = {
1005
- encode(message: StorageUpdateVersion, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1006
- if (message.eTag !== undefined) {
1007
- writer.uint32(10).string(message.eTag);
1008
- }
1009
- if (message.version !== undefined) {
1010
- writer.uint32(18).string(message.version);
1011
- }
1012
- return writer;
1013
- },
1014
-
1015
- decode(input: BinaryReader | Uint8Array, length?: number): StorageUpdateVersion {
1016
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1017
- const end = length === undefined ? reader.len : reader.pos + length;
1018
- const message = createBaseStorageUpdateVersion();
1019
- while (reader.pos < end) {
1020
- const tag = reader.uint32();
1021
- switch (tag >>> 3) {
1022
- case 1: {
1023
- if (tag !== 10) {
1024
- break;
1025
- }
1026
-
1027
- message.eTag = reader.string();
1028
- continue;
1029
- }
1030
- case 2: {
1031
- if (tag !== 18) {
1032
- break;
1033
- }
1034
-
1035
- message.version = reader.string();
1036
- continue;
1037
- }
1038
- }
1039
- if ((tag & 7) === 4 || tag === 0) {
1040
- break;
1041
- }
1042
- reader.skip(tag & 7);
1043
- }
1044
- return message;
1045
- },
1046
-
1047
- fromJSON(object: any): StorageUpdateVersion {
1048
- return {
1049
- eTag: isSet(object.eTag) ? globalThis.String(object.eTag) : undefined,
1050
- version: isSet(object.version) ? globalThis.String(object.version) : undefined,
1051
- };
1052
- },
1053
-
1054
- toJSON(message: StorageUpdateVersion): unknown {
1055
- const obj: any = {};
1056
- if (message.eTag !== undefined) {
1057
- obj.eTag = message.eTag;
1058
- }
1059
- if (message.version !== undefined) {
1060
- obj.version = message.version;
1061
- }
1062
- return obj;
1063
- },
1064
-
1065
- create(base?: DeepPartial<StorageUpdateVersion>): StorageUpdateVersion {
1066
- return StorageUpdateVersion.fromPartial(base ?? {});
1067
- },
1068
- fromPartial(object: DeepPartial<StorageUpdateVersion>): StorageUpdateVersion {
1069
- const message = createBaseStorageUpdateVersion();
1070
- message.eTag = object.eTag ?? undefined;
1071
- message.version = object.version ?? undefined;
1072
- return message;
1073
- },
1074
- };
1075
-
1076
- function createBaseStorageTag(): StorageTag {
1077
- return { key: "", value: "" };
1078
- }
1079
-
1080
- export const StorageTag: MessageFns<StorageTag> = {
1081
- encode(message: StorageTag, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1082
- if (message.key !== "") {
1083
- writer.uint32(10).string(message.key);
1084
- }
1085
- if (message.value !== "") {
1086
- writer.uint32(18).string(message.value);
1087
- }
1088
- return writer;
1089
- },
1090
-
1091
- decode(input: BinaryReader | Uint8Array, length?: number): StorageTag {
1092
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1093
- const end = length === undefined ? reader.len : reader.pos + length;
1094
- const message = createBaseStorageTag();
1095
- while (reader.pos < end) {
1096
- const tag = reader.uint32();
1097
- switch (tag >>> 3) {
1098
- case 1: {
1099
- if (tag !== 10) {
1100
- break;
1101
- }
1102
-
1103
- message.key = reader.string();
1104
- continue;
1105
- }
1106
- case 2: {
1107
- if (tag !== 18) {
1108
- break;
1109
- }
1110
-
1111
- message.value = reader.string();
1112
- continue;
1113
- }
1114
- }
1115
- if ((tag & 7) === 4 || tag === 0) {
1116
- break;
1117
- }
1118
- reader.skip(tag & 7);
1119
- }
1120
- return message;
1121
- },
1122
-
1123
- fromJSON(object: any): StorageTag {
1124
- return {
1125
- key: isSet(object.key) ? globalThis.String(object.key) : "",
1126
- value: isSet(object.value) ? globalThis.String(object.value) : "",
1127
- };
1128
- },
1129
-
1130
- toJSON(message: StorageTag): unknown {
1131
- const obj: any = {};
1132
- if (message.key !== "") {
1133
- obj.key = message.key;
1134
- }
1135
- if (message.value !== "") {
1136
- obj.value = message.value;
1137
- }
1138
- return obj;
1139
- },
1140
-
1141
- create(base?: DeepPartial<StorageTag>): StorageTag {
1142
- return StorageTag.fromPartial(base ?? {});
1143
- },
1144
- fromPartial(object: DeepPartial<StorageTag>): StorageTag {
1145
- const message = createBaseStorageTag();
1146
- message.key = object.key ?? "";
1147
- message.value = object.value ?? "";
1148
- return message;
1149
- },
1150
- };
1151
-
1152
- function createBaseStorageTagSet(): StorageTagSet {
1153
- return { tags: [] };
1154
- }
1155
-
1156
- export const StorageTagSet: MessageFns<StorageTagSet> = {
1157
- encode(message: StorageTagSet, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1158
- for (const v of message.tags) {
1159
- StorageTag.encode(v!, writer.uint32(10).fork()).join();
1160
- }
1161
- return writer;
1162
- },
1163
-
1164
- decode(input: BinaryReader | Uint8Array, length?: number): StorageTagSet {
1165
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1166
- const end = length === undefined ? reader.len : reader.pos + length;
1167
- const message = createBaseStorageTagSet();
1168
- while (reader.pos < end) {
1169
- const tag = reader.uint32();
1170
- switch (tag >>> 3) {
1171
- case 1: {
1172
- if (tag !== 10) {
1173
- break;
1174
- }
1175
-
1176
- message.tags.push(StorageTag.decode(reader, reader.uint32()));
1177
- continue;
1178
- }
1179
- }
1180
- if ((tag & 7) === 4 || tag === 0) {
1181
- break;
1182
- }
1183
- reader.skip(tag & 7);
1184
- }
1185
- return message;
1186
- },
1187
-
1188
- fromJSON(object: any): StorageTagSet {
1189
- return { tags: globalThis.Array.isArray(object?.tags) ? object.tags.map((e: any) => StorageTag.fromJSON(e)) : [] };
1190
- },
1191
-
1192
- toJSON(message: StorageTagSet): unknown {
1193
- const obj: any = {};
1194
- if (message.tags?.length) {
1195
- obj.tags = message.tags.map((e) => StorageTag.toJSON(e));
1196
- }
1197
- return obj;
1198
- },
1199
-
1200
- create(base?: DeepPartial<StorageTagSet>): StorageTagSet {
1201
- return StorageTagSet.fromPartial(base ?? {});
1202
- },
1203
- fromPartial(object: DeepPartial<StorageTagSet>): StorageTagSet {
1204
- const message = createBaseStorageTagSet();
1205
- message.tags = object.tags?.map((e) => StorageTag.fromPartial(e)) || [];
1206
- return message;
1207
- },
1208
- };
1209
-
1210
- function createBaseStorageAttributeKeyValuePair(): StorageAttributeKeyValuePair {
1211
- return { key: "", value: "" };
1212
- }
1213
-
1214
- export const StorageAttributeKeyValuePair: MessageFns<StorageAttributeKeyValuePair> = {
1215
- encode(message: StorageAttributeKeyValuePair, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1216
- if (message.key !== "") {
1217
- writer.uint32(10).string(message.key);
1218
- }
1219
- if (message.value !== "") {
1220
- writer.uint32(18).string(message.value);
1221
- }
1222
- return writer;
1223
- },
1224
-
1225
- decode(input: BinaryReader | Uint8Array, length?: number): StorageAttributeKeyValuePair {
1226
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1227
- const end = length === undefined ? reader.len : reader.pos + length;
1228
- const message = createBaseStorageAttributeKeyValuePair();
1229
- while (reader.pos < end) {
1230
- const tag = reader.uint32();
1231
- switch (tag >>> 3) {
1232
- case 1: {
1233
- if (tag !== 10) {
1234
- break;
1235
- }
1236
-
1237
- message.key = reader.string();
1238
- continue;
1239
- }
1240
- case 2: {
1241
- if (tag !== 18) {
1242
- break;
1243
- }
1244
-
1245
- message.value = reader.string();
1246
- continue;
1247
- }
1248
- }
1249
- if ((tag & 7) === 4 || tag === 0) {
1250
- break;
1251
- }
1252
- reader.skip(tag & 7);
1253
- }
1254
- return message;
1255
- },
1256
-
1257
- fromJSON(object: any): StorageAttributeKeyValuePair {
1258
- return {
1259
- key: isSet(object.key) ? globalThis.String(object.key) : "",
1260
- value: isSet(object.value) ? globalThis.String(object.value) : "",
1261
- };
1262
- },
1263
-
1264
- toJSON(message: StorageAttributeKeyValuePair): unknown {
1265
- const obj: any = {};
1266
- if (message.key !== "") {
1267
- obj.key = message.key;
1268
- }
1269
- if (message.value !== "") {
1270
- obj.value = message.value;
1271
- }
1272
- return obj;
1273
- },
1274
-
1275
- create(base?: DeepPartial<StorageAttributeKeyValuePair>): StorageAttributeKeyValuePair {
1276
- return StorageAttributeKeyValuePair.fromPartial(base ?? {});
1277
- },
1278
- fromPartial(object: DeepPartial<StorageAttributeKeyValuePair>): StorageAttributeKeyValuePair {
1279
- const message = createBaseStorageAttributeKeyValuePair();
1280
- message.key = object.key ?? "";
1281
- message.value = object.value ?? "";
1282
- return message;
1283
- },
1284
- };
1285
-
1286
- function createBaseStorageAttributesMap(): StorageAttributesMap {
1287
- return { pairs: [] };
1288
- }
1289
-
1290
- export const StorageAttributesMap: MessageFns<StorageAttributesMap> = {
1291
- encode(message: StorageAttributesMap, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1292
- for (const v of message.pairs) {
1293
- StorageAttributeKeyValuePair.encode(v!, writer.uint32(10).fork()).join();
1294
- }
1295
- return writer;
1296
- },
1297
-
1298
- decode(input: BinaryReader | Uint8Array, length?: number): StorageAttributesMap {
1299
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1300
- const end = length === undefined ? reader.len : reader.pos + length;
1301
- const message = createBaseStorageAttributesMap();
1302
- while (reader.pos < end) {
1303
- const tag = reader.uint32();
1304
- switch (tag >>> 3) {
1305
- case 1: {
1306
- if (tag !== 10) {
1307
- break;
1308
- }
1309
-
1310
- message.pairs.push(StorageAttributeKeyValuePair.decode(reader, reader.uint32()));
1311
- continue;
1312
- }
1313
- }
1314
- if ((tag & 7) === 4 || tag === 0) {
1315
- break;
1316
- }
1317
- reader.skip(tag & 7);
1318
- }
1319
- return message;
1320
- },
1321
-
1322
- fromJSON(object: any): StorageAttributesMap {
1323
- return {
1324
- pairs: globalThis.Array.isArray(object?.pairs)
1325
- ? object.pairs.map((e: any) => StorageAttributeKeyValuePair.fromJSON(e))
1326
- : [],
1327
- };
1328
- },
1329
-
1330
- toJSON(message: StorageAttributesMap): unknown {
1331
- const obj: any = {};
1332
- if (message.pairs?.length) {
1333
- obj.pairs = message.pairs.map((e) => StorageAttributeKeyValuePair.toJSON(e));
1334
- }
1335
- return obj;
1336
- },
1337
-
1338
- create(base?: DeepPartial<StorageAttributesMap>): StorageAttributesMap {
1339
- return StorageAttributesMap.fromPartial(base ?? {});
1340
- },
1341
- fromPartial(object: DeepPartial<StorageAttributesMap>): StorageAttributesMap {
1342
- const message = createBaseStorageAttributesMap();
1343
- message.pairs = object.pairs?.map((e) => StorageAttributeKeyValuePair.fromPartial(e)) || [];
1344
- return message;
1345
- },
1346
- };
1347
-
1348
- function createBaseStoragePutOptions(): StoragePutOptions {
1349
- return { mode: 0, updateVersionDetails: undefined, tags: undefined, attributes: undefined };
1350
- }
1351
-
1352
- export const StoragePutOptions: MessageFns<StoragePutOptions> = {
1353
- encode(message: StoragePutOptions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1354
- if (message.mode !== 0) {
1355
- writer.uint32(8).int32(message.mode);
1356
- }
1357
- if (message.updateVersionDetails !== undefined) {
1358
- StorageUpdateVersion.encode(message.updateVersionDetails, writer.uint32(18).fork()).join();
1359
- }
1360
- if (message.tags !== undefined) {
1361
- StorageTagSet.encode(message.tags, writer.uint32(26).fork()).join();
1362
- }
1363
- if (message.attributes !== undefined) {
1364
- StorageAttributesMap.encode(message.attributes, writer.uint32(34).fork()).join();
1365
- }
1366
- return writer;
1367
- },
1368
-
1369
- decode(input: BinaryReader | Uint8Array, length?: number): StoragePutOptions {
1370
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1371
- const end = length === undefined ? reader.len : reader.pos + length;
1372
- const message = createBaseStoragePutOptions();
1373
- while (reader.pos < end) {
1374
- const tag = reader.uint32();
1375
- switch (tag >>> 3) {
1376
- case 1: {
1377
- if (tag !== 8) {
1378
- break;
1379
- }
1380
-
1381
- message.mode = reader.int32() as any;
1382
- continue;
1383
- }
1384
- case 2: {
1385
- if (tag !== 18) {
1386
- break;
1387
- }
1388
-
1389
- message.updateVersionDetails = StorageUpdateVersion.decode(reader, reader.uint32());
1390
- continue;
1391
- }
1392
- case 3: {
1393
- if (tag !== 26) {
1394
- break;
1395
- }
1396
-
1397
- message.tags = StorageTagSet.decode(reader, reader.uint32());
1398
- continue;
1399
- }
1400
- case 4: {
1401
- if (tag !== 34) {
1402
- break;
1403
- }
1404
-
1405
- message.attributes = StorageAttributesMap.decode(reader, reader.uint32());
1406
- continue;
1407
- }
1408
- }
1409
- if ((tag & 7) === 4 || tag === 0) {
1410
- break;
1411
- }
1412
- reader.skip(tag & 7);
1413
- }
1414
- return message;
1415
- },
1416
-
1417
- fromJSON(object: any): StoragePutOptions {
1418
- return {
1419
- mode: isSet(object.mode) ? storagePutModeEnumFromJSON(object.mode) : 0,
1420
- updateVersionDetails: isSet(object.updateVersionDetails)
1421
- ? StorageUpdateVersion.fromJSON(object.updateVersionDetails)
1422
- : undefined,
1423
- tags: isSet(object.tags) ? StorageTagSet.fromJSON(object.tags) : undefined,
1424
- attributes: isSet(object.attributes) ? StorageAttributesMap.fromJSON(object.attributes) : undefined,
1425
- };
1426
- },
1427
-
1428
- toJSON(message: StoragePutOptions): unknown {
1429
- const obj: any = {};
1430
- if (message.mode !== 0) {
1431
- obj.mode = storagePutModeEnumToJSON(message.mode);
1432
- }
1433
- if (message.updateVersionDetails !== undefined) {
1434
- obj.updateVersionDetails = StorageUpdateVersion.toJSON(message.updateVersionDetails);
1435
- }
1436
- if (message.tags !== undefined) {
1437
- obj.tags = StorageTagSet.toJSON(message.tags);
1438
- }
1439
- if (message.attributes !== undefined) {
1440
- obj.attributes = StorageAttributesMap.toJSON(message.attributes);
1441
- }
1442
- return obj;
1443
- },
1444
-
1445
- create(base?: DeepPartial<StoragePutOptions>): StoragePutOptions {
1446
- return StoragePutOptions.fromPartial(base ?? {});
1447
- },
1448
- fromPartial(object: DeepPartial<StoragePutOptions>): StoragePutOptions {
1449
- const message = createBaseStoragePutOptions();
1450
- message.mode = object.mode ?? 0;
1451
- message.updateVersionDetails = (object.updateVersionDetails !== undefined && object.updateVersionDetails !== null)
1452
- ? StorageUpdateVersion.fromPartial(object.updateVersionDetails)
1453
- : undefined;
1454
- message.tags = (object.tags !== undefined && object.tags !== null)
1455
- ? StorageTagSet.fromPartial(object.tags)
1456
- : undefined;
1457
- message.attributes = (object.attributes !== undefined && object.attributes !== null)
1458
- ? StorageAttributesMap.fromPartial(object.attributes)
1459
- : undefined;
1460
- return message;
1461
- },
1462
- };
1463
-
1464
- function createBaseStoragePutMultipartOptions(): StoragePutMultipartOptions {
1465
- return { tags: undefined, attributes: undefined };
1466
- }
1467
-
1468
- export const StoragePutMultipartOptions: MessageFns<StoragePutMultipartOptions> = {
1469
- encode(message: StoragePutMultipartOptions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1470
- if (message.tags !== undefined) {
1471
- StorageTagSet.encode(message.tags, writer.uint32(10).fork()).join();
1472
- }
1473
- if (message.attributes !== undefined) {
1474
- StorageAttributesMap.encode(message.attributes, writer.uint32(18).fork()).join();
1475
- }
1476
- return writer;
1477
- },
1478
-
1479
- decode(input: BinaryReader | Uint8Array, length?: number): StoragePutMultipartOptions {
1480
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1481
- const end = length === undefined ? reader.len : reader.pos + length;
1482
- const message = createBaseStoragePutMultipartOptions();
1483
- while (reader.pos < end) {
1484
- const tag = reader.uint32();
1485
- switch (tag >>> 3) {
1486
- case 1: {
1487
- if (tag !== 10) {
1488
- break;
1489
- }
1490
-
1491
- message.tags = StorageTagSet.decode(reader, reader.uint32());
1492
- continue;
1493
- }
1494
- case 2: {
1495
- if (tag !== 18) {
1496
- break;
1497
- }
1498
-
1499
- message.attributes = StorageAttributesMap.decode(reader, reader.uint32());
1500
- continue;
1501
- }
1502
- }
1503
- if ((tag & 7) === 4 || tag === 0) {
1504
- break;
1505
- }
1506
- reader.skip(tag & 7);
1507
- }
1508
- return message;
1509
- },
1510
-
1511
- fromJSON(object: any): StoragePutMultipartOptions {
1512
- return {
1513
- tags: isSet(object.tags) ? StorageTagSet.fromJSON(object.tags) : undefined,
1514
- attributes: isSet(object.attributes) ? StorageAttributesMap.fromJSON(object.attributes) : undefined,
1515
- };
1516
- },
1517
-
1518
- toJSON(message: StoragePutMultipartOptions): unknown {
1519
- const obj: any = {};
1520
- if (message.tags !== undefined) {
1521
- obj.tags = StorageTagSet.toJSON(message.tags);
1522
- }
1523
- if (message.attributes !== undefined) {
1524
- obj.attributes = StorageAttributesMap.toJSON(message.attributes);
1525
- }
1526
- return obj;
1527
- },
1528
-
1529
- create(base?: DeepPartial<StoragePutMultipartOptions>): StoragePutMultipartOptions {
1530
- return StoragePutMultipartOptions.fromPartial(base ?? {});
1531
- },
1532
- fromPartial(object: DeepPartial<StoragePutMultipartOptions>): StoragePutMultipartOptions {
1533
- const message = createBaseStoragePutMultipartOptions();
1534
- message.tags = (object.tags !== undefined && object.tags !== null)
1535
- ? StorageTagSet.fromPartial(object.tags)
1536
- : undefined;
1537
- message.attributes = (object.attributes !== undefined && object.attributes !== null)
1538
- ? StorageAttributesMap.fromPartial(object.attributes)
1539
- : undefined;
1540
- return message;
1541
- },
1542
- };
1543
-
1544
- function createBaseStorageGetRequest(): StorageGetRequest {
1545
- return { bindingName: "", path: "", options: undefined };
1546
- }
1547
-
1548
- export const StorageGetRequest: MessageFns<StorageGetRequest> = {
1549
- encode(message: StorageGetRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1550
- if (message.bindingName !== "") {
1551
- writer.uint32(10).string(message.bindingName);
1552
- }
1553
- if (message.path !== "") {
1554
- writer.uint32(18).string(message.path);
1555
- }
1556
- if (message.options !== undefined) {
1557
- StorageGetOptions.encode(message.options, writer.uint32(26).fork()).join();
1558
- }
1559
- return writer;
1560
- },
1561
-
1562
- decode(input: BinaryReader | Uint8Array, length?: number): StorageGetRequest {
1563
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1564
- const end = length === undefined ? reader.len : reader.pos + length;
1565
- const message = createBaseStorageGetRequest();
1566
- while (reader.pos < end) {
1567
- const tag = reader.uint32();
1568
- switch (tag >>> 3) {
1569
- case 1: {
1570
- if (tag !== 10) {
1571
- break;
1572
- }
1573
-
1574
- message.bindingName = reader.string();
1575
- continue;
1576
- }
1577
- case 2: {
1578
- if (tag !== 18) {
1579
- break;
1580
- }
1581
-
1582
- message.path = reader.string();
1583
- continue;
1584
- }
1585
- case 3: {
1586
- if (tag !== 26) {
1587
- break;
1588
- }
1589
-
1590
- message.options = StorageGetOptions.decode(reader, reader.uint32());
1591
- continue;
1592
- }
1593
- }
1594
- if ((tag & 7) === 4 || tag === 0) {
1595
- break;
1596
- }
1597
- reader.skip(tag & 7);
1598
- }
1599
- return message;
1600
- },
1601
-
1602
- fromJSON(object: any): StorageGetRequest {
1603
- return {
1604
- bindingName: isSet(object.bindingName) ? globalThis.String(object.bindingName) : "",
1605
- path: isSet(object.path) ? globalThis.String(object.path) : "",
1606
- options: isSet(object.options) ? StorageGetOptions.fromJSON(object.options) : undefined,
1607
- };
1608
- },
1609
-
1610
- toJSON(message: StorageGetRequest): unknown {
1611
- const obj: any = {};
1612
- if (message.bindingName !== "") {
1613
- obj.bindingName = message.bindingName;
1614
- }
1615
- if (message.path !== "") {
1616
- obj.path = message.path;
1617
- }
1618
- if (message.options !== undefined) {
1619
- obj.options = StorageGetOptions.toJSON(message.options);
1620
- }
1621
- return obj;
1622
- },
1623
-
1624
- create(base?: DeepPartial<StorageGetRequest>): StorageGetRequest {
1625
- return StorageGetRequest.fromPartial(base ?? {});
1626
- },
1627
- fromPartial(object: DeepPartial<StorageGetRequest>): StorageGetRequest {
1628
- const message = createBaseStorageGetRequest();
1629
- message.bindingName = object.bindingName ?? "";
1630
- message.path = object.path ?? "";
1631
- message.options = (object.options !== undefined && object.options !== null)
1632
- ? StorageGetOptions.fromPartial(object.options)
1633
- : undefined;
1634
- return message;
1635
- },
1636
- };
1637
-
1638
- function createBaseStorageChunkResponse(): StorageChunkResponse {
1639
- return { chunkData: new Uint8Array(0) };
1640
- }
1641
-
1642
- export const StorageChunkResponse: MessageFns<StorageChunkResponse> = {
1643
- encode(message: StorageChunkResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1644
- if (message.chunkData.length !== 0) {
1645
- writer.uint32(10).bytes(message.chunkData);
1646
- }
1647
- return writer;
1648
- },
1649
-
1650
- decode(input: BinaryReader | Uint8Array, length?: number): StorageChunkResponse {
1651
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1652
- const end = length === undefined ? reader.len : reader.pos + length;
1653
- const message = createBaseStorageChunkResponse();
1654
- while (reader.pos < end) {
1655
- const tag = reader.uint32();
1656
- switch (tag >>> 3) {
1657
- case 1: {
1658
- if (tag !== 10) {
1659
- break;
1660
- }
1661
-
1662
- message.chunkData = reader.bytes();
1663
- continue;
1664
- }
1665
- }
1666
- if ((tag & 7) === 4 || tag === 0) {
1667
- break;
1668
- }
1669
- reader.skip(tag & 7);
1670
- }
1671
- return message;
1672
- },
1673
-
1674
- fromJSON(object: any): StorageChunkResponse {
1675
- return { chunkData: isSet(object.chunkData) ? bytesFromBase64(object.chunkData) : new Uint8Array(0) };
1676
- },
1677
-
1678
- toJSON(message: StorageChunkResponse): unknown {
1679
- const obj: any = {};
1680
- if (message.chunkData.length !== 0) {
1681
- obj.chunkData = base64FromBytes(message.chunkData);
1682
- }
1683
- return obj;
1684
- },
1685
-
1686
- create(base?: DeepPartial<StorageChunkResponse>): StorageChunkResponse {
1687
- return StorageChunkResponse.fromPartial(base ?? {});
1688
- },
1689
- fromPartial(object: DeepPartial<StorageChunkResponse>): StorageChunkResponse {
1690
- const message = createBaseStorageChunkResponse();
1691
- message.chunkData = object.chunkData ?? new Uint8Array(0);
1692
- return message;
1693
- },
1694
- };
1695
-
1696
- function createBaseGetResponsePart(): GetResponsePart {
1697
- return { metadata: undefined, chunkData: undefined };
1698
- }
1699
-
1700
- export const GetResponsePart: MessageFns<GetResponsePart> = {
1701
- encode(message: GetResponsePart, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1702
- if (message.metadata !== undefined) {
1703
- StorageObjectMeta.encode(message.metadata, writer.uint32(10).fork()).join();
1704
- }
1705
- if (message.chunkData !== undefined) {
1706
- writer.uint32(18).bytes(message.chunkData);
1707
- }
1708
- return writer;
1709
- },
1710
-
1711
- decode(input: BinaryReader | Uint8Array, length?: number): GetResponsePart {
1712
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1713
- const end = length === undefined ? reader.len : reader.pos + length;
1714
- const message = createBaseGetResponsePart();
1715
- while (reader.pos < end) {
1716
- const tag = reader.uint32();
1717
- switch (tag >>> 3) {
1718
- case 1: {
1719
- if (tag !== 10) {
1720
- break;
1721
- }
1722
-
1723
- message.metadata = StorageObjectMeta.decode(reader, reader.uint32());
1724
- continue;
1725
- }
1726
- case 2: {
1727
- if (tag !== 18) {
1728
- break;
1729
- }
1730
-
1731
- message.chunkData = reader.bytes();
1732
- continue;
1733
- }
1734
- }
1735
- if ((tag & 7) === 4 || tag === 0) {
1736
- break;
1737
- }
1738
- reader.skip(tag & 7);
1739
- }
1740
- return message;
1741
- },
1742
-
1743
- fromJSON(object: any): GetResponsePart {
1744
- return {
1745
- metadata: isSet(object.metadata) ? StorageObjectMeta.fromJSON(object.metadata) : undefined,
1746
- chunkData: isSet(object.chunkData) ? bytesFromBase64(object.chunkData) : undefined,
1747
- };
1748
- },
1749
-
1750
- toJSON(message: GetResponsePart): unknown {
1751
- const obj: any = {};
1752
- if (message.metadata !== undefined) {
1753
- obj.metadata = StorageObjectMeta.toJSON(message.metadata);
1754
- }
1755
- if (message.chunkData !== undefined) {
1756
- obj.chunkData = base64FromBytes(message.chunkData);
1757
- }
1758
- return obj;
1759
- },
1760
-
1761
- create(base?: DeepPartial<GetResponsePart>): GetResponsePart {
1762
- return GetResponsePart.fromPartial(base ?? {});
1763
- },
1764
- fromPartial(object: DeepPartial<GetResponsePart>): GetResponsePart {
1765
- const message = createBaseGetResponsePart();
1766
- message.metadata = (object.metadata !== undefined && object.metadata !== null)
1767
- ? StorageObjectMeta.fromPartial(object.metadata)
1768
- : undefined;
1769
- message.chunkData = object.chunkData ?? undefined;
1770
- return message;
1771
- },
1772
- };
1773
-
1774
- function createBaseStoragePutMultipartChunkRequest(): StoragePutMultipartChunkRequest {
1775
- return { metadata: undefined, chunkData: undefined };
1776
- }
1777
-
1778
- export const StoragePutMultipartChunkRequest: MessageFns<StoragePutMultipartChunkRequest> = {
1779
- encode(message: StoragePutMultipartChunkRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1780
- if (message.metadata !== undefined) {
1781
- StoragePutMultipartMetadata.encode(message.metadata, writer.uint32(10).fork()).join();
1782
- }
1783
- if (message.chunkData !== undefined) {
1784
- writer.uint32(18).bytes(message.chunkData);
1785
- }
1786
- return writer;
1787
- },
1788
-
1789
- decode(input: BinaryReader | Uint8Array, length?: number): StoragePutMultipartChunkRequest {
1790
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1791
- const end = length === undefined ? reader.len : reader.pos + length;
1792
- const message = createBaseStoragePutMultipartChunkRequest();
1793
- while (reader.pos < end) {
1794
- const tag = reader.uint32();
1795
- switch (tag >>> 3) {
1796
- case 1: {
1797
- if (tag !== 10) {
1798
- break;
1799
- }
1800
-
1801
- message.metadata = StoragePutMultipartMetadata.decode(reader, reader.uint32());
1802
- continue;
1803
- }
1804
- case 2: {
1805
- if (tag !== 18) {
1806
- break;
1807
- }
1808
-
1809
- message.chunkData = reader.bytes();
1810
- continue;
1811
- }
1812
- }
1813
- if ((tag & 7) === 4 || tag === 0) {
1814
- break;
1815
- }
1816
- reader.skip(tag & 7);
1817
- }
1818
- return message;
1819
- },
1820
-
1821
- fromJSON(object: any): StoragePutMultipartChunkRequest {
1822
- return {
1823
- metadata: isSet(object.metadata) ? StoragePutMultipartMetadata.fromJSON(object.metadata) : undefined,
1824
- chunkData: isSet(object.chunkData) ? bytesFromBase64(object.chunkData) : undefined,
1825
- };
1826
- },
1827
-
1828
- toJSON(message: StoragePutMultipartChunkRequest): unknown {
1829
- const obj: any = {};
1830
- if (message.metadata !== undefined) {
1831
- obj.metadata = StoragePutMultipartMetadata.toJSON(message.metadata);
1832
- }
1833
- if (message.chunkData !== undefined) {
1834
- obj.chunkData = base64FromBytes(message.chunkData);
1835
- }
1836
- return obj;
1837
- },
1838
-
1839
- create(base?: DeepPartial<StoragePutMultipartChunkRequest>): StoragePutMultipartChunkRequest {
1840
- return StoragePutMultipartChunkRequest.fromPartial(base ?? {});
1841
- },
1842
- fromPartial(object: DeepPartial<StoragePutMultipartChunkRequest>): StoragePutMultipartChunkRequest {
1843
- const message = createBaseStoragePutMultipartChunkRequest();
1844
- message.metadata = (object.metadata !== undefined && object.metadata !== null)
1845
- ? StoragePutMultipartMetadata.fromPartial(object.metadata)
1846
- : undefined;
1847
- message.chunkData = object.chunkData ?? undefined;
1848
- return message;
1849
- },
1850
- };
1851
-
1852
- function createBaseStoragePutMultipartMetadata(): StoragePutMultipartMetadata {
1853
- return { bindingName: "", path: "", options: undefined };
1854
- }
1855
-
1856
- export const StoragePutMultipartMetadata: MessageFns<StoragePutMultipartMetadata> = {
1857
- encode(message: StoragePutMultipartMetadata, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1858
- if (message.bindingName !== "") {
1859
- writer.uint32(10).string(message.bindingName);
1860
- }
1861
- if (message.path !== "") {
1862
- writer.uint32(18).string(message.path);
1863
- }
1864
- if (message.options !== undefined) {
1865
- StoragePutMultipartOptions.encode(message.options, writer.uint32(26).fork()).join();
1866
- }
1867
- return writer;
1868
- },
1869
-
1870
- decode(input: BinaryReader | Uint8Array, length?: number): StoragePutMultipartMetadata {
1871
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1872
- const end = length === undefined ? reader.len : reader.pos + length;
1873
- const message = createBaseStoragePutMultipartMetadata();
1874
- while (reader.pos < end) {
1875
- const tag = reader.uint32();
1876
- switch (tag >>> 3) {
1877
- case 1: {
1878
- if (tag !== 10) {
1879
- break;
1880
- }
1881
-
1882
- message.bindingName = reader.string();
1883
- continue;
1884
- }
1885
- case 2: {
1886
- if (tag !== 18) {
1887
- break;
1888
- }
1889
-
1890
- message.path = reader.string();
1891
- continue;
1892
- }
1893
- case 3: {
1894
- if (tag !== 26) {
1895
- break;
1896
- }
1897
-
1898
- message.options = StoragePutMultipartOptions.decode(reader, reader.uint32());
1899
- continue;
1900
- }
1901
- }
1902
- if ((tag & 7) === 4 || tag === 0) {
1903
- break;
1904
- }
1905
- reader.skip(tag & 7);
1906
- }
1907
- return message;
1908
- },
1909
-
1910
- fromJSON(object: any): StoragePutMultipartMetadata {
1911
- return {
1912
- bindingName: isSet(object.bindingName) ? globalThis.String(object.bindingName) : "",
1913
- path: isSet(object.path) ? globalThis.String(object.path) : "",
1914
- options: isSet(object.options) ? StoragePutMultipartOptions.fromJSON(object.options) : undefined,
1915
- };
1916
- },
1917
-
1918
- toJSON(message: StoragePutMultipartMetadata): unknown {
1919
- const obj: any = {};
1920
- if (message.bindingName !== "") {
1921
- obj.bindingName = message.bindingName;
1922
- }
1923
- if (message.path !== "") {
1924
- obj.path = message.path;
1925
- }
1926
- if (message.options !== undefined) {
1927
- obj.options = StoragePutMultipartOptions.toJSON(message.options);
1928
- }
1929
- return obj;
1930
- },
1931
-
1932
- create(base?: DeepPartial<StoragePutMultipartMetadata>): StoragePutMultipartMetadata {
1933
- return StoragePutMultipartMetadata.fromPartial(base ?? {});
1934
- },
1935
- fromPartial(object: DeepPartial<StoragePutMultipartMetadata>): StoragePutMultipartMetadata {
1936
- const message = createBaseStoragePutMultipartMetadata();
1937
- message.bindingName = object.bindingName ?? "";
1938
- message.path = object.path ?? "";
1939
- message.options = (object.options !== undefined && object.options !== null)
1940
- ? StoragePutMultipartOptions.fromPartial(object.options)
1941
- : undefined;
1942
- return message;
1943
- },
1944
- };
1945
-
1946
- function createBaseStoragePutResponse(): StoragePutResponse {
1947
- return { eTag: undefined, version: undefined };
1948
- }
1949
-
1950
- export const StoragePutResponse: MessageFns<StoragePutResponse> = {
1951
- encode(message: StoragePutResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1952
- if (message.eTag !== undefined) {
1953
- writer.uint32(10).string(message.eTag);
1954
- }
1955
- if (message.version !== undefined) {
1956
- writer.uint32(18).string(message.version);
1957
- }
1958
- return writer;
1959
- },
1960
-
1961
- decode(input: BinaryReader | Uint8Array, length?: number): StoragePutResponse {
1962
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1963
- const end = length === undefined ? reader.len : reader.pos + length;
1964
- const message = createBaseStoragePutResponse();
1965
- while (reader.pos < end) {
1966
- const tag = reader.uint32();
1967
- switch (tag >>> 3) {
1968
- case 1: {
1969
- if (tag !== 10) {
1970
- break;
1971
- }
1972
-
1973
- message.eTag = reader.string();
1974
- continue;
1975
- }
1976
- case 2: {
1977
- if (tag !== 18) {
1978
- break;
1979
- }
1980
-
1981
- message.version = reader.string();
1982
- continue;
1983
- }
1984
- }
1985
- if ((tag & 7) === 4 || tag === 0) {
1986
- break;
1987
- }
1988
- reader.skip(tag & 7);
1989
- }
1990
- return message;
1991
- },
1992
-
1993
- fromJSON(object: any): StoragePutResponse {
1994
- return {
1995
- eTag: isSet(object.eTag) ? globalThis.String(object.eTag) : undefined,
1996
- version: isSet(object.version) ? globalThis.String(object.version) : undefined,
1997
- };
1998
- },
1999
-
2000
- toJSON(message: StoragePutResponse): unknown {
2001
- const obj: any = {};
2002
- if (message.eTag !== undefined) {
2003
- obj.eTag = message.eTag;
2004
- }
2005
- if (message.version !== undefined) {
2006
- obj.version = message.version;
2007
- }
2008
- return obj;
2009
- },
2010
-
2011
- create(base?: DeepPartial<StoragePutResponse>): StoragePutResponse {
2012
- return StoragePutResponse.fromPartial(base ?? {});
2013
- },
2014
- fromPartial(object: DeepPartial<StoragePutResponse>): StoragePutResponse {
2015
- const message = createBaseStoragePutResponse();
2016
- message.eTag = object.eTag ?? undefined;
2017
- message.version = object.version ?? undefined;
2018
- return message;
2019
- },
2020
- };
2021
-
2022
- function createBaseStoragePutRequest(): StoragePutRequest {
2023
- return { bindingName: "", path: "", data: new Uint8Array(0), options: undefined };
2024
- }
2025
-
2026
- export const StoragePutRequest: MessageFns<StoragePutRequest> = {
2027
- encode(message: StoragePutRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
2028
- if (message.bindingName !== "") {
2029
- writer.uint32(10).string(message.bindingName);
2030
- }
2031
- if (message.path !== "") {
2032
- writer.uint32(18).string(message.path);
2033
- }
2034
- if (message.data.length !== 0) {
2035
- writer.uint32(26).bytes(message.data);
2036
- }
2037
- if (message.options !== undefined) {
2038
- StoragePutOptions.encode(message.options, writer.uint32(34).fork()).join();
2039
- }
2040
- return writer;
2041
- },
2042
-
2043
- decode(input: BinaryReader | Uint8Array, length?: number): StoragePutRequest {
2044
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2045
- const end = length === undefined ? reader.len : reader.pos + length;
2046
- const message = createBaseStoragePutRequest();
2047
- while (reader.pos < end) {
2048
- const tag = reader.uint32();
2049
- switch (tag >>> 3) {
2050
- case 1: {
2051
- if (tag !== 10) {
2052
- break;
2053
- }
2054
-
2055
- message.bindingName = reader.string();
2056
- continue;
2057
- }
2058
- case 2: {
2059
- if (tag !== 18) {
2060
- break;
2061
- }
2062
-
2063
- message.path = reader.string();
2064
- continue;
2065
- }
2066
- case 3: {
2067
- if (tag !== 26) {
2068
- break;
2069
- }
2070
-
2071
- message.data = reader.bytes();
2072
- continue;
2073
- }
2074
- case 4: {
2075
- if (tag !== 34) {
2076
- break;
2077
- }
2078
-
2079
- message.options = StoragePutOptions.decode(reader, reader.uint32());
2080
- continue;
2081
- }
2082
- }
2083
- if ((tag & 7) === 4 || tag === 0) {
2084
- break;
2085
- }
2086
- reader.skip(tag & 7);
2087
- }
2088
- return message;
2089
- },
2090
-
2091
- fromJSON(object: any): StoragePutRequest {
2092
- return {
2093
- bindingName: isSet(object.bindingName) ? globalThis.String(object.bindingName) : "",
2094
- path: isSet(object.path) ? globalThis.String(object.path) : "",
2095
- data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(0),
2096
- options: isSet(object.options) ? StoragePutOptions.fromJSON(object.options) : undefined,
2097
- };
2098
- },
2099
-
2100
- toJSON(message: StoragePutRequest): unknown {
2101
- const obj: any = {};
2102
- if (message.bindingName !== "") {
2103
- obj.bindingName = message.bindingName;
2104
- }
2105
- if (message.path !== "") {
2106
- obj.path = message.path;
2107
- }
2108
- if (message.data.length !== 0) {
2109
- obj.data = base64FromBytes(message.data);
2110
- }
2111
- if (message.options !== undefined) {
2112
- obj.options = StoragePutOptions.toJSON(message.options);
2113
- }
2114
- return obj;
2115
- },
2116
-
2117
- create(base?: DeepPartial<StoragePutRequest>): StoragePutRequest {
2118
- return StoragePutRequest.fromPartial(base ?? {});
2119
- },
2120
- fromPartial(object: DeepPartial<StoragePutRequest>): StoragePutRequest {
2121
- const message = createBaseStoragePutRequest();
2122
- message.bindingName = object.bindingName ?? "";
2123
- message.path = object.path ?? "";
2124
- message.data = object.data ?? new Uint8Array(0);
2125
- message.options = (object.options !== undefined && object.options !== null)
2126
- ? StoragePutOptions.fromPartial(object.options)
2127
- : undefined;
2128
- return message;
2129
- },
2130
- };
2131
-
2132
- function createBaseStorageDeleteRequest(): StorageDeleteRequest {
2133
- return { bindingName: "", path: "" };
2134
- }
2135
-
2136
- export const StorageDeleteRequest: MessageFns<StorageDeleteRequest> = {
2137
- encode(message: StorageDeleteRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
2138
- if (message.bindingName !== "") {
2139
- writer.uint32(10).string(message.bindingName);
2140
- }
2141
- if (message.path !== "") {
2142
- writer.uint32(18).string(message.path);
2143
- }
2144
- return writer;
2145
- },
2146
-
2147
- decode(input: BinaryReader | Uint8Array, length?: number): StorageDeleteRequest {
2148
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2149
- const end = length === undefined ? reader.len : reader.pos + length;
2150
- const message = createBaseStorageDeleteRequest();
2151
- while (reader.pos < end) {
2152
- const tag = reader.uint32();
2153
- switch (tag >>> 3) {
2154
- case 1: {
2155
- if (tag !== 10) {
2156
- break;
2157
- }
2158
-
2159
- message.bindingName = reader.string();
2160
- continue;
2161
- }
2162
- case 2: {
2163
- if (tag !== 18) {
2164
- break;
2165
- }
2166
-
2167
- message.path = reader.string();
2168
- continue;
2169
- }
2170
- }
2171
- if ((tag & 7) === 4 || tag === 0) {
2172
- break;
2173
- }
2174
- reader.skip(tag & 7);
2175
- }
2176
- return message;
2177
- },
2178
-
2179
- fromJSON(object: any): StorageDeleteRequest {
2180
- return {
2181
- bindingName: isSet(object.bindingName) ? globalThis.String(object.bindingName) : "",
2182
- path: isSet(object.path) ? globalThis.String(object.path) : "",
2183
- };
2184
- },
2185
-
2186
- toJSON(message: StorageDeleteRequest): unknown {
2187
- const obj: any = {};
2188
- if (message.bindingName !== "") {
2189
- obj.bindingName = message.bindingName;
2190
- }
2191
- if (message.path !== "") {
2192
- obj.path = message.path;
2193
- }
2194
- return obj;
2195
- },
2196
-
2197
- create(base?: DeepPartial<StorageDeleteRequest>): StorageDeleteRequest {
2198
- return StorageDeleteRequest.fromPartial(base ?? {});
2199
- },
2200
- fromPartial(object: DeepPartial<StorageDeleteRequest>): StorageDeleteRequest {
2201
- const message = createBaseStorageDeleteRequest();
2202
- message.bindingName = object.bindingName ?? "";
2203
- message.path = object.path ?? "";
2204
- return message;
2205
- },
2206
- };
2207
-
2208
- function createBaseStorageOperationResponse(): StorageOperationResponse {
2209
- return {};
2210
- }
2211
-
2212
- export const StorageOperationResponse: MessageFns<StorageOperationResponse> = {
2213
- encode(_: StorageOperationResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
2214
- return writer;
2215
- },
2216
-
2217
- decode(input: BinaryReader | Uint8Array, length?: number): StorageOperationResponse {
2218
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2219
- const end = length === undefined ? reader.len : reader.pos + length;
2220
- const message = createBaseStorageOperationResponse();
2221
- while (reader.pos < end) {
2222
- const tag = reader.uint32();
2223
- switch (tag >>> 3) {
2224
- }
2225
- if ((tag & 7) === 4 || tag === 0) {
2226
- break;
2227
- }
2228
- reader.skip(tag & 7);
2229
- }
2230
- return message;
2231
- },
2232
-
2233
- fromJSON(_: any): StorageOperationResponse {
2234
- return {};
2235
- },
2236
-
2237
- toJSON(_: StorageOperationResponse): unknown {
2238
- const obj: any = {};
2239
- return obj;
2240
- },
2241
-
2242
- create(base?: DeepPartial<StorageOperationResponse>): StorageOperationResponse {
2243
- return StorageOperationResponse.fromPartial(base ?? {});
2244
- },
2245
- fromPartial(_: DeepPartial<StorageOperationResponse>): StorageOperationResponse {
2246
- const message = createBaseStorageOperationResponse();
2247
- return message;
2248
- },
2249
- };
2250
-
2251
- function createBaseStorageListRequest(): StorageListRequest {
2252
- return { bindingName: "", prefix: undefined, offset: undefined };
2253
- }
2254
-
2255
- export const StorageListRequest: MessageFns<StorageListRequest> = {
2256
- encode(message: StorageListRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
2257
- if (message.bindingName !== "") {
2258
- writer.uint32(10).string(message.bindingName);
2259
- }
2260
- if (message.prefix !== undefined) {
2261
- writer.uint32(18).string(message.prefix);
2262
- }
2263
- if (message.offset !== undefined) {
2264
- writer.uint32(26).string(message.offset);
2265
- }
2266
- return writer;
2267
- },
2268
-
2269
- decode(input: BinaryReader | Uint8Array, length?: number): StorageListRequest {
2270
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2271
- const end = length === undefined ? reader.len : reader.pos + length;
2272
- const message = createBaseStorageListRequest();
2273
- while (reader.pos < end) {
2274
- const tag = reader.uint32();
2275
- switch (tag >>> 3) {
2276
- case 1: {
2277
- if (tag !== 10) {
2278
- break;
2279
- }
2280
-
2281
- message.bindingName = reader.string();
2282
- continue;
2283
- }
2284
- case 2: {
2285
- if (tag !== 18) {
2286
- break;
2287
- }
2288
-
2289
- message.prefix = reader.string();
2290
- continue;
2291
- }
2292
- case 3: {
2293
- if (tag !== 26) {
2294
- break;
2295
- }
2296
-
2297
- message.offset = reader.string();
2298
- continue;
2299
- }
2300
- }
2301
- if ((tag & 7) === 4 || tag === 0) {
2302
- break;
2303
- }
2304
- reader.skip(tag & 7);
2305
- }
2306
- return message;
2307
- },
2308
-
2309
- fromJSON(object: any): StorageListRequest {
2310
- return {
2311
- bindingName: isSet(object.bindingName) ? globalThis.String(object.bindingName) : "",
2312
- prefix: isSet(object.prefix) ? globalThis.String(object.prefix) : undefined,
2313
- offset: isSet(object.offset) ? globalThis.String(object.offset) : undefined,
2314
- };
2315
- },
2316
-
2317
- toJSON(message: StorageListRequest): unknown {
2318
- const obj: any = {};
2319
- if (message.bindingName !== "") {
2320
- obj.bindingName = message.bindingName;
2321
- }
2322
- if (message.prefix !== undefined) {
2323
- obj.prefix = message.prefix;
2324
- }
2325
- if (message.offset !== undefined) {
2326
- obj.offset = message.offset;
2327
- }
2328
- return obj;
2329
- },
2330
-
2331
- create(base?: DeepPartial<StorageListRequest>): StorageListRequest {
2332
- return StorageListRequest.fromPartial(base ?? {});
2333
- },
2334
- fromPartial(object: DeepPartial<StorageListRequest>): StorageListRequest {
2335
- const message = createBaseStorageListRequest();
2336
- message.bindingName = object.bindingName ?? "";
2337
- message.prefix = object.prefix ?? undefined;
2338
- message.offset = object.offset ?? undefined;
2339
- return message;
2340
- },
2341
- };
2342
-
2343
- function createBaseStorageObjectMeta(): StorageObjectMeta {
2344
- return { location: "", lastModified: undefined, size: 0, eTag: undefined, version: undefined };
2345
- }
2346
-
2347
- export const StorageObjectMeta: MessageFns<StorageObjectMeta> = {
2348
- encode(message: StorageObjectMeta, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
2349
- if (message.location !== "") {
2350
- writer.uint32(10).string(message.location);
2351
- }
2352
- if (message.lastModified !== undefined) {
2353
- Timestamp.encode(toTimestamp(message.lastModified), writer.uint32(18).fork()).join();
2354
- }
2355
- if (message.size !== 0) {
2356
- writer.uint32(24).uint64(message.size);
2357
- }
2358
- if (message.eTag !== undefined) {
2359
- writer.uint32(34).string(message.eTag);
2360
- }
2361
- if (message.version !== undefined) {
2362
- writer.uint32(42).string(message.version);
2363
- }
2364
- return writer;
2365
- },
2366
-
2367
- decode(input: BinaryReader | Uint8Array, length?: number): StorageObjectMeta {
2368
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2369
- const end = length === undefined ? reader.len : reader.pos + length;
2370
- const message = createBaseStorageObjectMeta();
2371
- while (reader.pos < end) {
2372
- const tag = reader.uint32();
2373
- switch (tag >>> 3) {
2374
- case 1: {
2375
- if (tag !== 10) {
2376
- break;
2377
- }
2378
-
2379
- message.location = reader.string();
2380
- continue;
2381
- }
2382
- case 2: {
2383
- if (tag !== 18) {
2384
- break;
2385
- }
2386
-
2387
- message.lastModified = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
2388
- continue;
2389
- }
2390
- case 3: {
2391
- if (tag !== 24) {
2392
- break;
2393
- }
2394
-
2395
- message.size = longToNumber(reader.uint64());
2396
- continue;
2397
- }
2398
- case 4: {
2399
- if (tag !== 34) {
2400
- break;
2401
- }
2402
-
2403
- message.eTag = reader.string();
2404
- continue;
2405
- }
2406
- case 5: {
2407
- if (tag !== 42) {
2408
- break;
2409
- }
2410
-
2411
- message.version = reader.string();
2412
- continue;
2413
- }
2414
- }
2415
- if ((tag & 7) === 4 || tag === 0) {
2416
- break;
2417
- }
2418
- reader.skip(tag & 7);
2419
- }
2420
- return message;
2421
- },
2422
-
2423
- fromJSON(object: any): StorageObjectMeta {
2424
- return {
2425
- location: isSet(object.location) ? globalThis.String(object.location) : "",
2426
- lastModified: isSet(object.lastModified) ? fromJsonTimestamp(object.lastModified) : undefined,
2427
- size: isSet(object.size) ? globalThis.Number(object.size) : 0,
2428
- eTag: isSet(object.eTag) ? globalThis.String(object.eTag) : undefined,
2429
- version: isSet(object.version) ? globalThis.String(object.version) : undefined,
2430
- };
2431
- },
2432
-
2433
- toJSON(message: StorageObjectMeta): unknown {
2434
- const obj: any = {};
2435
- if (message.location !== "") {
2436
- obj.location = message.location;
2437
- }
2438
- if (message.lastModified !== undefined) {
2439
- obj.lastModified = message.lastModified.toISOString();
2440
- }
2441
- if (message.size !== 0) {
2442
- obj.size = Math.round(message.size);
2443
- }
2444
- if (message.eTag !== undefined) {
2445
- obj.eTag = message.eTag;
2446
- }
2447
- if (message.version !== undefined) {
2448
- obj.version = message.version;
2449
- }
2450
- return obj;
2451
- },
2452
-
2453
- create(base?: DeepPartial<StorageObjectMeta>): StorageObjectMeta {
2454
- return StorageObjectMeta.fromPartial(base ?? {});
2455
- },
2456
- fromPartial(object: DeepPartial<StorageObjectMeta>): StorageObjectMeta {
2457
- const message = createBaseStorageObjectMeta();
2458
- message.location = object.location ?? "";
2459
- message.lastModified = object.lastModified ?? undefined;
2460
- message.size = object.size ?? 0;
2461
- message.eTag = object.eTag ?? undefined;
2462
- message.version = object.version ?? undefined;
2463
- return message;
2464
- },
2465
- };
2466
-
2467
- function createBaseStorageListWithDelimiterRequest(): StorageListWithDelimiterRequest {
2468
- return { bindingName: "", prefix: undefined };
2469
- }
2470
-
2471
- export const StorageListWithDelimiterRequest: MessageFns<StorageListWithDelimiterRequest> = {
2472
- encode(message: StorageListWithDelimiterRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
2473
- if (message.bindingName !== "") {
2474
- writer.uint32(10).string(message.bindingName);
2475
- }
2476
- if (message.prefix !== undefined) {
2477
- writer.uint32(18).string(message.prefix);
2478
- }
2479
- return writer;
2480
- },
2481
-
2482
- decode(input: BinaryReader | Uint8Array, length?: number): StorageListWithDelimiterRequest {
2483
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2484
- const end = length === undefined ? reader.len : reader.pos + length;
2485
- const message = createBaseStorageListWithDelimiterRequest();
2486
- while (reader.pos < end) {
2487
- const tag = reader.uint32();
2488
- switch (tag >>> 3) {
2489
- case 1: {
2490
- if (tag !== 10) {
2491
- break;
2492
- }
2493
-
2494
- message.bindingName = reader.string();
2495
- continue;
2496
- }
2497
- case 2: {
2498
- if (tag !== 18) {
2499
- break;
2500
- }
2501
-
2502
- message.prefix = reader.string();
2503
- continue;
2504
- }
2505
- }
2506
- if ((tag & 7) === 4 || tag === 0) {
2507
- break;
2508
- }
2509
- reader.skip(tag & 7);
2510
- }
2511
- return message;
2512
- },
2513
-
2514
- fromJSON(object: any): StorageListWithDelimiterRequest {
2515
- return {
2516
- bindingName: isSet(object.bindingName) ? globalThis.String(object.bindingName) : "",
2517
- prefix: isSet(object.prefix) ? globalThis.String(object.prefix) : undefined,
2518
- };
2519
- },
2520
-
2521
- toJSON(message: StorageListWithDelimiterRequest): unknown {
2522
- const obj: any = {};
2523
- if (message.bindingName !== "") {
2524
- obj.bindingName = message.bindingName;
2525
- }
2526
- if (message.prefix !== undefined) {
2527
- obj.prefix = message.prefix;
2528
- }
2529
- return obj;
2530
- },
2531
-
2532
- create(base?: DeepPartial<StorageListWithDelimiterRequest>): StorageListWithDelimiterRequest {
2533
- return StorageListWithDelimiterRequest.fromPartial(base ?? {});
2534
- },
2535
- fromPartial(object: DeepPartial<StorageListWithDelimiterRequest>): StorageListWithDelimiterRequest {
2536
- const message = createBaseStorageListWithDelimiterRequest();
2537
- message.bindingName = object.bindingName ?? "";
2538
- message.prefix = object.prefix ?? undefined;
2539
- return message;
2540
- },
2541
- };
2542
-
2543
- function createBaseStorageListResultProto(): StorageListResultProto {
2544
- return { commonPrefixes: [], objects: [] };
2545
- }
2546
-
2547
- export const StorageListResultProto: MessageFns<StorageListResultProto> = {
2548
- encode(message: StorageListResultProto, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
2549
- for (const v of message.commonPrefixes) {
2550
- writer.uint32(10).string(v!);
2551
- }
2552
- for (const v of message.objects) {
2553
- StorageObjectMeta.encode(v!, writer.uint32(18).fork()).join();
2554
- }
2555
- return writer;
2556
- },
2557
-
2558
- decode(input: BinaryReader | Uint8Array, length?: number): StorageListResultProto {
2559
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2560
- const end = length === undefined ? reader.len : reader.pos + length;
2561
- const message = createBaseStorageListResultProto();
2562
- while (reader.pos < end) {
2563
- const tag = reader.uint32();
2564
- switch (tag >>> 3) {
2565
- case 1: {
2566
- if (tag !== 10) {
2567
- break;
2568
- }
2569
-
2570
- message.commonPrefixes.push(reader.string());
2571
- continue;
2572
- }
2573
- case 2: {
2574
- if (tag !== 18) {
2575
- break;
2576
- }
2577
-
2578
- message.objects.push(StorageObjectMeta.decode(reader, reader.uint32()));
2579
- continue;
2580
- }
2581
- }
2582
- if ((tag & 7) === 4 || tag === 0) {
2583
- break;
2584
- }
2585
- reader.skip(tag & 7);
2586
- }
2587
- return message;
2588
- },
2589
-
2590
- fromJSON(object: any): StorageListResultProto {
2591
- return {
2592
- commonPrefixes: globalThis.Array.isArray(object?.commonPrefixes)
2593
- ? object.commonPrefixes.map((e: any) => globalThis.String(e))
2594
- : [],
2595
- objects: globalThis.Array.isArray(object?.objects)
2596
- ? object.objects.map((e: any) => StorageObjectMeta.fromJSON(e))
2597
- : [],
2598
- };
2599
- },
2600
-
2601
- toJSON(message: StorageListResultProto): unknown {
2602
- const obj: any = {};
2603
- if (message.commonPrefixes?.length) {
2604
- obj.commonPrefixes = message.commonPrefixes;
2605
- }
2606
- if (message.objects?.length) {
2607
- obj.objects = message.objects.map((e) => StorageObjectMeta.toJSON(e));
2608
- }
2609
- return obj;
2610
- },
2611
-
2612
- create(base?: DeepPartial<StorageListResultProto>): StorageListResultProto {
2613
- return StorageListResultProto.fromPartial(base ?? {});
2614
- },
2615
- fromPartial(object: DeepPartial<StorageListResultProto>): StorageListResultProto {
2616
- const message = createBaseStorageListResultProto();
2617
- message.commonPrefixes = object.commonPrefixes?.map((e) => e) || [];
2618
- message.objects = object.objects?.map((e) => StorageObjectMeta.fromPartial(e)) || [];
2619
- return message;
2620
- },
2621
- };
2622
-
2623
- function createBaseStorageHeadRequest(): StorageHeadRequest {
2624
- return { bindingName: "", path: "" };
2625
- }
2626
-
2627
- export const StorageHeadRequest: MessageFns<StorageHeadRequest> = {
2628
- encode(message: StorageHeadRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
2629
- if (message.bindingName !== "") {
2630
- writer.uint32(10).string(message.bindingName);
2631
- }
2632
- if (message.path !== "") {
2633
- writer.uint32(18).string(message.path);
2634
- }
2635
- return writer;
2636
- },
2637
-
2638
- decode(input: BinaryReader | Uint8Array, length?: number): StorageHeadRequest {
2639
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2640
- const end = length === undefined ? reader.len : reader.pos + length;
2641
- const message = createBaseStorageHeadRequest();
2642
- while (reader.pos < end) {
2643
- const tag = reader.uint32();
2644
- switch (tag >>> 3) {
2645
- case 1: {
2646
- if (tag !== 10) {
2647
- break;
2648
- }
2649
-
2650
- message.bindingName = reader.string();
2651
- continue;
2652
- }
2653
- case 2: {
2654
- if (tag !== 18) {
2655
- break;
2656
- }
2657
-
2658
- message.path = reader.string();
2659
- continue;
2660
- }
2661
- }
2662
- if ((tag & 7) === 4 || tag === 0) {
2663
- break;
2664
- }
2665
- reader.skip(tag & 7);
2666
- }
2667
- return message;
2668
- },
2669
-
2670
- fromJSON(object: any): StorageHeadRequest {
2671
- return {
2672
- bindingName: isSet(object.bindingName) ? globalThis.String(object.bindingName) : "",
2673
- path: isSet(object.path) ? globalThis.String(object.path) : "",
2674
- };
2675
- },
2676
-
2677
- toJSON(message: StorageHeadRequest): unknown {
2678
- const obj: any = {};
2679
- if (message.bindingName !== "") {
2680
- obj.bindingName = message.bindingName;
2681
- }
2682
- if (message.path !== "") {
2683
- obj.path = message.path;
2684
- }
2685
- return obj;
2686
- },
2687
-
2688
- create(base?: DeepPartial<StorageHeadRequest>): StorageHeadRequest {
2689
- return StorageHeadRequest.fromPartial(base ?? {});
2690
- },
2691
- fromPartial(object: DeepPartial<StorageHeadRequest>): StorageHeadRequest {
2692
- const message = createBaseStorageHeadRequest();
2693
- message.bindingName = object.bindingName ?? "";
2694
- message.path = object.path ?? "";
2695
- return message;
2696
- },
2697
- };
2698
-
2699
- function createBaseStorageGetBaseDirRequest(): StorageGetBaseDirRequest {
2700
- return { bindingName: "" };
2701
- }
2702
-
2703
- export const StorageGetBaseDirRequest: MessageFns<StorageGetBaseDirRequest> = {
2704
- encode(message: StorageGetBaseDirRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
2705
- if (message.bindingName !== "") {
2706
- writer.uint32(10).string(message.bindingName);
2707
- }
2708
- return writer;
2709
- },
2710
-
2711
- decode(input: BinaryReader | Uint8Array, length?: number): StorageGetBaseDirRequest {
2712
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2713
- const end = length === undefined ? reader.len : reader.pos + length;
2714
- const message = createBaseStorageGetBaseDirRequest();
2715
- while (reader.pos < end) {
2716
- const tag = reader.uint32();
2717
- switch (tag >>> 3) {
2718
- case 1: {
2719
- if (tag !== 10) {
2720
- break;
2721
- }
2722
-
2723
- message.bindingName = reader.string();
2724
- continue;
2725
- }
2726
- }
2727
- if ((tag & 7) === 4 || tag === 0) {
2728
- break;
2729
- }
2730
- reader.skip(tag & 7);
2731
- }
2732
- return message;
2733
- },
2734
-
2735
- fromJSON(object: any): StorageGetBaseDirRequest {
2736
- return { bindingName: isSet(object.bindingName) ? globalThis.String(object.bindingName) : "" };
2737
- },
2738
-
2739
- toJSON(message: StorageGetBaseDirRequest): unknown {
2740
- const obj: any = {};
2741
- if (message.bindingName !== "") {
2742
- obj.bindingName = message.bindingName;
2743
- }
2744
- return obj;
2745
- },
2746
-
2747
- create(base?: DeepPartial<StorageGetBaseDirRequest>): StorageGetBaseDirRequest {
2748
- return StorageGetBaseDirRequest.fromPartial(base ?? {});
2749
- },
2750
- fromPartial(object: DeepPartial<StorageGetBaseDirRequest>): StorageGetBaseDirRequest {
2751
- const message = createBaseStorageGetBaseDirRequest();
2752
- message.bindingName = object.bindingName ?? "";
2753
- return message;
2754
- },
2755
- };
2756
-
2757
- function createBaseStorageGetBaseDirResponse(): StorageGetBaseDirResponse {
2758
- return { path: "" };
2759
- }
2760
-
2761
- export const StorageGetBaseDirResponse: MessageFns<StorageGetBaseDirResponse> = {
2762
- encode(message: StorageGetBaseDirResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
2763
- if (message.path !== "") {
2764
- writer.uint32(10).string(message.path);
2765
- }
2766
- return writer;
2767
- },
2768
-
2769
- decode(input: BinaryReader | Uint8Array, length?: number): StorageGetBaseDirResponse {
2770
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2771
- const end = length === undefined ? reader.len : reader.pos + length;
2772
- const message = createBaseStorageGetBaseDirResponse();
2773
- while (reader.pos < end) {
2774
- const tag = reader.uint32();
2775
- switch (tag >>> 3) {
2776
- case 1: {
2777
- if (tag !== 10) {
2778
- break;
2779
- }
2780
-
2781
- message.path = reader.string();
2782
- continue;
2783
- }
2784
- }
2785
- if ((tag & 7) === 4 || tag === 0) {
2786
- break;
2787
- }
2788
- reader.skip(tag & 7);
2789
- }
2790
- return message;
2791
- },
2792
-
2793
- fromJSON(object: any): StorageGetBaseDirResponse {
2794
- return { path: isSet(object.path) ? globalThis.String(object.path) : "" };
2795
- },
2796
-
2797
- toJSON(message: StorageGetBaseDirResponse): unknown {
2798
- const obj: any = {};
2799
- if (message.path !== "") {
2800
- obj.path = message.path;
2801
- }
2802
- return obj;
2803
- },
2804
-
2805
- create(base?: DeepPartial<StorageGetBaseDirResponse>): StorageGetBaseDirResponse {
2806
- return StorageGetBaseDirResponse.fromPartial(base ?? {});
2807
- },
2808
- fromPartial(object: DeepPartial<StorageGetBaseDirResponse>): StorageGetBaseDirResponse {
2809
- const message = createBaseStorageGetBaseDirResponse();
2810
- message.path = object.path ?? "";
2811
- return message;
2812
- },
2813
- };
2814
-
2815
- function createBaseStorageGetUrlRequest(): StorageGetUrlRequest {
2816
- return { bindingName: "" };
2817
- }
2818
-
2819
- export const StorageGetUrlRequest: MessageFns<StorageGetUrlRequest> = {
2820
- encode(message: StorageGetUrlRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
2821
- if (message.bindingName !== "") {
2822
- writer.uint32(10).string(message.bindingName);
2823
- }
2824
- return writer;
2825
- },
2826
-
2827
- decode(input: BinaryReader | Uint8Array, length?: number): StorageGetUrlRequest {
2828
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2829
- const end = length === undefined ? reader.len : reader.pos + length;
2830
- const message = createBaseStorageGetUrlRequest();
2831
- while (reader.pos < end) {
2832
- const tag = reader.uint32();
2833
- switch (tag >>> 3) {
2834
- case 1: {
2835
- if (tag !== 10) {
2836
- break;
2837
- }
2838
-
2839
- message.bindingName = reader.string();
2840
- continue;
2841
- }
2842
- }
2843
- if ((tag & 7) === 4 || tag === 0) {
2844
- break;
2845
- }
2846
- reader.skip(tag & 7);
2847
- }
2848
- return message;
2849
- },
2850
-
2851
- fromJSON(object: any): StorageGetUrlRequest {
2852
- return { bindingName: isSet(object.bindingName) ? globalThis.String(object.bindingName) : "" };
2853
- },
2854
-
2855
- toJSON(message: StorageGetUrlRequest): unknown {
2856
- const obj: any = {};
2857
- if (message.bindingName !== "") {
2858
- obj.bindingName = message.bindingName;
2859
- }
2860
- return obj;
2861
- },
2862
-
2863
- create(base?: DeepPartial<StorageGetUrlRequest>): StorageGetUrlRequest {
2864
- return StorageGetUrlRequest.fromPartial(base ?? {});
2865
- },
2866
- fromPartial(object: DeepPartial<StorageGetUrlRequest>): StorageGetUrlRequest {
2867
- const message = createBaseStorageGetUrlRequest();
2868
- message.bindingName = object.bindingName ?? "";
2869
- return message;
2870
- },
2871
- };
2872
-
2873
- function createBaseStorageGetUrlResponse(): StorageGetUrlResponse {
2874
- return { url: "" };
2875
- }
2876
-
2877
- export const StorageGetUrlResponse: MessageFns<StorageGetUrlResponse> = {
2878
- encode(message: StorageGetUrlResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
2879
- if (message.url !== "") {
2880
- writer.uint32(10).string(message.url);
2881
- }
2882
- return writer;
2883
- },
2884
-
2885
- decode(input: BinaryReader | Uint8Array, length?: number): StorageGetUrlResponse {
2886
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2887
- const end = length === undefined ? reader.len : reader.pos + length;
2888
- const message = createBaseStorageGetUrlResponse();
2889
- while (reader.pos < end) {
2890
- const tag = reader.uint32();
2891
- switch (tag >>> 3) {
2892
- case 1: {
2893
- if (tag !== 10) {
2894
- break;
2895
- }
2896
-
2897
- message.url = reader.string();
2898
- continue;
2899
- }
2900
- }
2901
- if ((tag & 7) === 4 || tag === 0) {
2902
- break;
2903
- }
2904
- reader.skip(tag & 7);
2905
- }
2906
- return message;
2907
- },
2908
-
2909
- fromJSON(object: any): StorageGetUrlResponse {
2910
- return { url: isSet(object.url) ? globalThis.String(object.url) : "" };
2911
- },
2912
-
2913
- toJSON(message: StorageGetUrlResponse): unknown {
2914
- const obj: any = {};
2915
- if (message.url !== "") {
2916
- obj.url = message.url;
2917
- }
2918
- return obj;
2919
- },
2920
-
2921
- create(base?: DeepPartial<StorageGetUrlResponse>): StorageGetUrlResponse {
2922
- return StorageGetUrlResponse.fromPartial(base ?? {});
2923
- },
2924
- fromPartial(object: DeepPartial<StorageGetUrlResponse>): StorageGetUrlResponse {
2925
- const message = createBaseStorageGetUrlResponse();
2926
- message.url = object.url ?? "";
2927
- return message;
2928
- },
2929
- };
2930
-
2931
- function createBaseStorageCopyRequest(): StorageCopyRequest {
2932
- return { bindingName: "", fromPath: "", toPath: "" };
2933
- }
2934
-
2935
- export const StorageCopyRequest: MessageFns<StorageCopyRequest> = {
2936
- encode(message: StorageCopyRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
2937
- if (message.bindingName !== "") {
2938
- writer.uint32(10).string(message.bindingName);
2939
- }
2940
- if (message.fromPath !== "") {
2941
- writer.uint32(18).string(message.fromPath);
2942
- }
2943
- if (message.toPath !== "") {
2944
- writer.uint32(26).string(message.toPath);
2945
- }
2946
- return writer;
2947
- },
2948
-
2949
- decode(input: BinaryReader | Uint8Array, length?: number): StorageCopyRequest {
2950
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2951
- const end = length === undefined ? reader.len : reader.pos + length;
2952
- const message = createBaseStorageCopyRequest();
2953
- while (reader.pos < end) {
2954
- const tag = reader.uint32();
2955
- switch (tag >>> 3) {
2956
- case 1: {
2957
- if (tag !== 10) {
2958
- break;
2959
- }
2960
-
2961
- message.bindingName = reader.string();
2962
- continue;
2963
- }
2964
- case 2: {
2965
- if (tag !== 18) {
2966
- break;
2967
- }
2968
-
2969
- message.fromPath = reader.string();
2970
- continue;
2971
- }
2972
- case 3: {
2973
- if (tag !== 26) {
2974
- break;
2975
- }
2976
-
2977
- message.toPath = reader.string();
2978
- continue;
2979
- }
2980
- }
2981
- if ((tag & 7) === 4 || tag === 0) {
2982
- break;
2983
- }
2984
- reader.skip(tag & 7);
2985
- }
2986
- return message;
2987
- },
2988
-
2989
- fromJSON(object: any): StorageCopyRequest {
2990
- return {
2991
- bindingName: isSet(object.bindingName) ? globalThis.String(object.bindingName) : "",
2992
- fromPath: isSet(object.fromPath) ? globalThis.String(object.fromPath) : "",
2993
- toPath: isSet(object.toPath) ? globalThis.String(object.toPath) : "",
2994
- };
2995
- },
2996
-
2997
- toJSON(message: StorageCopyRequest): unknown {
2998
- const obj: any = {};
2999
- if (message.bindingName !== "") {
3000
- obj.bindingName = message.bindingName;
3001
- }
3002
- if (message.fromPath !== "") {
3003
- obj.fromPath = message.fromPath;
3004
- }
3005
- if (message.toPath !== "") {
3006
- obj.toPath = message.toPath;
3007
- }
3008
- return obj;
3009
- },
3010
-
3011
- create(base?: DeepPartial<StorageCopyRequest>): StorageCopyRequest {
3012
- return StorageCopyRequest.fromPartial(base ?? {});
3013
- },
3014
- fromPartial(object: DeepPartial<StorageCopyRequest>): StorageCopyRequest {
3015
- const message = createBaseStorageCopyRequest();
3016
- message.bindingName = object.bindingName ?? "";
3017
- message.fromPath = object.fromPath ?? "";
3018
- message.toPath = object.toPath ?? "";
3019
- return message;
3020
- },
3021
- };
3022
-
3023
- function createBaseStorageRenameRequest(): StorageRenameRequest {
3024
- return { bindingName: "", fromPath: "", toPath: "" };
3025
- }
3026
-
3027
- export const StorageRenameRequest: MessageFns<StorageRenameRequest> = {
3028
- encode(message: StorageRenameRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
3029
- if (message.bindingName !== "") {
3030
- writer.uint32(10).string(message.bindingName);
3031
- }
3032
- if (message.fromPath !== "") {
3033
- writer.uint32(18).string(message.fromPath);
3034
- }
3035
- if (message.toPath !== "") {
3036
- writer.uint32(26).string(message.toPath);
3037
- }
3038
- return writer;
3039
- },
3040
-
3041
- decode(input: BinaryReader | Uint8Array, length?: number): StorageRenameRequest {
3042
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
3043
- const end = length === undefined ? reader.len : reader.pos + length;
3044
- const message = createBaseStorageRenameRequest();
3045
- while (reader.pos < end) {
3046
- const tag = reader.uint32();
3047
- switch (tag >>> 3) {
3048
- case 1: {
3049
- if (tag !== 10) {
3050
- break;
3051
- }
3052
-
3053
- message.bindingName = reader.string();
3054
- continue;
3055
- }
3056
- case 2: {
3057
- if (tag !== 18) {
3058
- break;
3059
- }
3060
-
3061
- message.fromPath = reader.string();
3062
- continue;
3063
- }
3064
- case 3: {
3065
- if (tag !== 26) {
3066
- break;
3067
- }
3068
-
3069
- message.toPath = reader.string();
3070
- continue;
3071
- }
3072
- }
3073
- if ((tag & 7) === 4 || tag === 0) {
3074
- break;
3075
- }
3076
- reader.skip(tag & 7);
3077
- }
3078
- return message;
3079
- },
3080
-
3081
- fromJSON(object: any): StorageRenameRequest {
3082
- return {
3083
- bindingName: isSet(object.bindingName) ? globalThis.String(object.bindingName) : "",
3084
- fromPath: isSet(object.fromPath) ? globalThis.String(object.fromPath) : "",
3085
- toPath: isSet(object.toPath) ? globalThis.String(object.toPath) : "",
3086
- };
3087
- },
3088
-
3089
- toJSON(message: StorageRenameRequest): unknown {
3090
- const obj: any = {};
3091
- if (message.bindingName !== "") {
3092
- obj.bindingName = message.bindingName;
3093
- }
3094
- if (message.fromPath !== "") {
3095
- obj.fromPath = message.fromPath;
3096
- }
3097
- if (message.toPath !== "") {
3098
- obj.toPath = message.toPath;
3099
- }
3100
- return obj;
3101
- },
3102
-
3103
- create(base?: DeepPartial<StorageRenameRequest>): StorageRenameRequest {
3104
- return StorageRenameRequest.fromPartial(base ?? {});
3105
- },
3106
- fromPartial(object: DeepPartial<StorageRenameRequest>): StorageRenameRequest {
3107
- const message = createBaseStorageRenameRequest();
3108
- message.bindingName = object.bindingName ?? "";
3109
- message.fromPath = object.fromPath ?? "";
3110
- message.toPath = object.toPath ?? "";
3111
- return message;
3112
- },
3113
- };
3114
-
3115
- function createBaseStorageSignedUrlRequest(): StorageSignedUrlRequest {
3116
- return { bindingName: "", path: "", httpMethod: 0, expirationTime: undefined };
3117
- }
3118
-
3119
- export const StorageSignedUrlRequest: MessageFns<StorageSignedUrlRequest> = {
3120
- encode(message: StorageSignedUrlRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
3121
- if (message.bindingName !== "") {
3122
- writer.uint32(10).string(message.bindingName);
3123
- }
3124
- if (message.path !== "") {
3125
- writer.uint32(18).string(message.path);
3126
- }
3127
- if (message.httpMethod !== 0) {
3128
- writer.uint32(24).int32(message.httpMethod);
3129
- }
3130
- if (message.expirationTime !== undefined) {
3131
- Timestamp.encode(toTimestamp(message.expirationTime), writer.uint32(34).fork()).join();
3132
- }
3133
- return writer;
3134
- },
3135
-
3136
- decode(input: BinaryReader | Uint8Array, length?: number): StorageSignedUrlRequest {
3137
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
3138
- const end = length === undefined ? reader.len : reader.pos + length;
3139
- const message = createBaseStorageSignedUrlRequest();
3140
- while (reader.pos < end) {
3141
- const tag = reader.uint32();
3142
- switch (tag >>> 3) {
3143
- case 1: {
3144
- if (tag !== 10) {
3145
- break;
3146
- }
3147
-
3148
- message.bindingName = reader.string();
3149
- continue;
3150
- }
3151
- case 2: {
3152
- if (tag !== 18) {
3153
- break;
3154
- }
3155
-
3156
- message.path = reader.string();
3157
- continue;
3158
- }
3159
- case 3: {
3160
- if (tag !== 24) {
3161
- break;
3162
- }
3163
-
3164
- message.httpMethod = reader.int32() as any;
3165
- continue;
3166
- }
3167
- case 4: {
3168
- if (tag !== 34) {
3169
- break;
3170
- }
3171
-
3172
- message.expirationTime = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
3173
- continue;
3174
- }
3175
- }
3176
- if ((tag & 7) === 4 || tag === 0) {
3177
- break;
3178
- }
3179
- reader.skip(tag & 7);
3180
- }
3181
- return message;
3182
- },
3183
-
3184
- fromJSON(object: any): StorageSignedUrlRequest {
3185
- return {
3186
- bindingName: isSet(object.bindingName) ? globalThis.String(object.bindingName) : "",
3187
- path: isSet(object.path) ? globalThis.String(object.path) : "",
3188
- httpMethod: isSet(object.httpMethod) ? storageHttpMethodFromJSON(object.httpMethod) : 0,
3189
- expirationTime: isSet(object.expirationTime) ? fromJsonTimestamp(object.expirationTime) : undefined,
3190
- };
3191
- },
3192
-
3193
- toJSON(message: StorageSignedUrlRequest): unknown {
3194
- const obj: any = {};
3195
- if (message.bindingName !== "") {
3196
- obj.bindingName = message.bindingName;
3197
- }
3198
- if (message.path !== "") {
3199
- obj.path = message.path;
3200
- }
3201
- if (message.httpMethod !== 0) {
3202
- obj.httpMethod = storageHttpMethodToJSON(message.httpMethod);
3203
- }
3204
- if (message.expirationTime !== undefined) {
3205
- obj.expirationTime = message.expirationTime.toISOString();
3206
- }
3207
- return obj;
3208
- },
3209
-
3210
- create(base?: DeepPartial<StorageSignedUrlRequest>): StorageSignedUrlRequest {
3211
- return StorageSignedUrlRequest.fromPartial(base ?? {});
3212
- },
3213
- fromPartial(object: DeepPartial<StorageSignedUrlRequest>): StorageSignedUrlRequest {
3214
- const message = createBaseStorageSignedUrlRequest();
3215
- message.bindingName = object.bindingName ?? "";
3216
- message.path = object.path ?? "";
3217
- message.httpMethod = object.httpMethod ?? 0;
3218
- message.expirationTime = object.expirationTime ?? undefined;
3219
- return message;
3220
- },
3221
- };
3222
-
3223
- function createBaseStorageSignedUrlResponse(): StorageSignedUrlResponse {
3224
- return { url: "" };
3225
- }
3226
-
3227
- export const StorageSignedUrlResponse: MessageFns<StorageSignedUrlResponse> = {
3228
- encode(message: StorageSignedUrlResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
3229
- if (message.url !== "") {
3230
- writer.uint32(10).string(message.url);
3231
- }
3232
- return writer;
3233
- },
3234
-
3235
- decode(input: BinaryReader | Uint8Array, length?: number): StorageSignedUrlResponse {
3236
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
3237
- const end = length === undefined ? reader.len : reader.pos + length;
3238
- const message = createBaseStorageSignedUrlResponse();
3239
- while (reader.pos < end) {
3240
- const tag = reader.uint32();
3241
- switch (tag >>> 3) {
3242
- case 1: {
3243
- if (tag !== 10) {
3244
- break;
3245
- }
3246
-
3247
- message.url = reader.string();
3248
- continue;
3249
- }
3250
- }
3251
- if ((tag & 7) === 4 || tag === 0) {
3252
- break;
3253
- }
3254
- reader.skip(tag & 7);
3255
- }
3256
- return message;
3257
- },
3258
-
3259
- fromJSON(object: any): StorageSignedUrlResponse {
3260
- return { url: isSet(object.url) ? globalThis.String(object.url) : "" };
3261
- },
3262
-
3263
- toJSON(message: StorageSignedUrlResponse): unknown {
3264
- const obj: any = {};
3265
- if (message.url !== "") {
3266
- obj.url = message.url;
3267
- }
3268
- return obj;
3269
- },
3270
-
3271
- create(base?: DeepPartial<StorageSignedUrlResponse>): StorageSignedUrlResponse {
3272
- return StorageSignedUrlResponse.fromPartial(base ?? {});
3273
- },
3274
- fromPartial(object: DeepPartial<StorageSignedUrlResponse>): StorageSignedUrlResponse {
3275
- const message = createBaseStorageSignedUrlResponse();
3276
- message.url = object.url ?? "";
3277
- return message;
3278
- },
3279
- };
3280
-
3281
- /** Service to interact with Storage bindings. */
3282
- export type StorageServiceDefinition = typeof StorageServiceDefinition;
3283
- export const StorageServiceDefinition = {
3284
- name: "StorageService",
3285
- fullName: "alien_bindings.storage.StorageService",
3286
- methods: {
3287
- /**
3288
- * Retrieves data for a given object in a storage binding, with options.
3289
- * The first part of the stream will be GetResponsePart.Metadata, followed by GetResponsePart.ChunkData.
3290
- */
3291
- get: {
3292
- name: "Get",
3293
- requestType: StorageGetRequest,
3294
- requestStream: false,
3295
- responseType: GetResponsePart,
3296
- responseStream: true,
3297
- options: {},
3298
- },
3299
- /**
3300
- * Uploads data to a storage binding using a stream.
3301
- * The first chunk in the stream must be metadata including PutMultipartOptions.
3302
- */
3303
- putMultipart: {
3304
- name: "PutMultipart",
3305
- requestType: StoragePutMultipartChunkRequest,
3306
- requestStream: true,
3307
- responseType: StoragePutResponse,
3308
- responseStream: false,
3309
- options: {},
3310
- },
3311
- /** Uploads data to a storage binding in a single message, with PutOptions. */
3312
- put: {
3313
- name: "Put",
3314
- requestType: StoragePutRequest,
3315
- requestStream: false,
3316
- responseType: StoragePutResponse,
3317
- responseStream: false,
3318
- options: {},
3319
- },
3320
- /** Deletes an object from a storage binding. */
3321
- delete: {
3322
- name: "Delete",
3323
- requestType: StorageDeleteRequest,
3324
- requestStream: false,
3325
- responseType: StorageOperationResponse,
3326
- responseStream: false,
3327
- options: {},
3328
- },
3329
- /**
3330
- * Lists objects in a storage binding, optionally filtered by a prefix and offset.
3331
- * Returns a stream of object metadata.
3332
- */
3333
- list: {
3334
- name: "List",
3335
- requestType: StorageListRequest,
3336
- requestStream: false,
3337
- responseType: StorageObjectMeta,
3338
- responseStream: true,
3339
- options: {},
3340
- },
3341
- /** Lists objects and common prefixes (directories) with a delimiter. */
3342
- listWithDelimiter: {
3343
- name: "ListWithDelimiter",
3344
- requestType: StorageListWithDelimiterRequest,
3345
- requestStream: false,
3346
- responseType: StorageListResultProto,
3347
- responseStream: false,
3348
- options: {},
3349
- },
3350
- /** Retrieves metadata for an object in a storage binding. */
3351
- head: {
3352
- name: "Head",
3353
- requestType: StorageHeadRequest,
3354
- requestStream: false,
3355
- responseType: StorageObjectMeta,
3356
- responseStream: false,
3357
- options: {},
3358
- },
3359
- /** Gets the base directory path for a storage binding. */
3360
- getBaseDir: {
3361
- name: "GetBaseDir",
3362
- requestType: StorageGetBaseDirRequest,
3363
- requestStream: false,
3364
- responseType: StorageGetBaseDirResponse,
3365
- responseStream: false,
3366
- options: {},
3367
- },
3368
- /** Gets the underlying URL for a storage binding. */
3369
- getUrl: {
3370
- name: "GetUrl",
3371
- requestType: StorageGetUrlRequest,
3372
- requestStream: false,
3373
- responseType: StorageGetUrlResponse,
3374
- responseStream: false,
3375
- options: {},
3376
- },
3377
- /** Copies an object within the same storage binding. */
3378
- copy: {
3379
- name: "Copy",
3380
- requestType: StorageCopyRequest,
3381
- requestStream: false,
3382
- responseType: StorageOperationResponse,
3383
- responseStream: false,
3384
- options: {},
3385
- },
3386
- /** Renames (moves) an object within the same storage binding. */
3387
- rename: {
3388
- name: "Rename",
3389
- requestType: StorageRenameRequest,
3390
- requestStream: false,
3391
- responseType: StorageOperationResponse,
3392
- responseStream: false,
3393
- options: {},
3394
- },
3395
- /** Copies an object if the destination does not exist. */
3396
- copyIfNotExists: {
3397
- name: "CopyIfNotExists",
3398
- requestType: StorageCopyRequest,
3399
- requestStream: false,
3400
- responseType: StorageOperationResponse,
3401
- responseStream: false,
3402
- options: {},
3403
- },
3404
- /** Renames (moves) an object if the destination does not exist. */
3405
- renameIfNotExists: {
3406
- name: "RenameIfNotExists",
3407
- requestType: StorageRenameRequest,
3408
- requestStream: false,
3409
- responseType: StorageOperationResponse,
3410
- responseStream: false,
3411
- options: {},
3412
- },
3413
- /** Generates a signed URL for an object that allows access without authentication. */
3414
- signedUrl: {
3415
- name: "SignedUrl",
3416
- requestType: StorageSignedUrlRequest,
3417
- requestStream: false,
3418
- responseType: StorageSignedUrlResponse,
3419
- responseStream: false,
3420
- options: {},
3421
- },
3422
- },
3423
- } as const;
3424
-
3425
- export interface StorageServiceImplementation<CallContextExt = {}> {
3426
- /**
3427
- * Retrieves data for a given object in a storage binding, with options.
3428
- * The first part of the stream will be GetResponsePart.Metadata, followed by GetResponsePart.ChunkData.
3429
- */
3430
- get(
3431
- request: StorageGetRequest,
3432
- context: CallContext & CallContextExt,
3433
- ): ServerStreamingMethodResult<DeepPartial<GetResponsePart>>;
3434
- /**
3435
- * Uploads data to a storage binding using a stream.
3436
- * The first chunk in the stream must be metadata including PutMultipartOptions.
3437
- */
3438
- putMultipart(
3439
- request: AsyncIterable<StoragePutMultipartChunkRequest>,
3440
- context: CallContext & CallContextExt,
3441
- ): Promise<DeepPartial<StoragePutResponse>>;
3442
- /** Uploads data to a storage binding in a single message, with PutOptions. */
3443
- put(request: StoragePutRequest, context: CallContext & CallContextExt): Promise<DeepPartial<StoragePutResponse>>;
3444
- /** Deletes an object from a storage binding. */
3445
- delete(
3446
- request: StorageDeleteRequest,
3447
- context: CallContext & CallContextExt,
3448
- ): Promise<DeepPartial<StorageOperationResponse>>;
3449
- /**
3450
- * Lists objects in a storage binding, optionally filtered by a prefix and offset.
3451
- * Returns a stream of object metadata.
3452
- */
3453
- list(
3454
- request: StorageListRequest,
3455
- context: CallContext & CallContextExt,
3456
- ): ServerStreamingMethodResult<DeepPartial<StorageObjectMeta>>;
3457
- /** Lists objects and common prefixes (directories) with a delimiter. */
3458
- listWithDelimiter(
3459
- request: StorageListWithDelimiterRequest,
3460
- context: CallContext & CallContextExt,
3461
- ): Promise<DeepPartial<StorageListResultProto>>;
3462
- /** Retrieves metadata for an object in a storage binding. */
3463
- head(request: StorageHeadRequest, context: CallContext & CallContextExt): Promise<DeepPartial<StorageObjectMeta>>;
3464
- /** Gets the base directory path for a storage binding. */
3465
- getBaseDir(
3466
- request: StorageGetBaseDirRequest,
3467
- context: CallContext & CallContextExt,
3468
- ): Promise<DeepPartial<StorageGetBaseDirResponse>>;
3469
- /** Gets the underlying URL for a storage binding. */
3470
- getUrl(
3471
- request: StorageGetUrlRequest,
3472
- context: CallContext & CallContextExt,
3473
- ): Promise<DeepPartial<StorageGetUrlResponse>>;
3474
- /** Copies an object within the same storage binding. */
3475
- copy(
3476
- request: StorageCopyRequest,
3477
- context: CallContext & CallContextExt,
3478
- ): Promise<DeepPartial<StorageOperationResponse>>;
3479
- /** Renames (moves) an object within the same storage binding. */
3480
- rename(
3481
- request: StorageRenameRequest,
3482
- context: CallContext & CallContextExt,
3483
- ): Promise<DeepPartial<StorageOperationResponse>>;
3484
- /** Copies an object if the destination does not exist. */
3485
- copyIfNotExists(
3486
- request: StorageCopyRequest,
3487
- context: CallContext & CallContextExt,
3488
- ): Promise<DeepPartial<StorageOperationResponse>>;
3489
- /** Renames (moves) an object if the destination does not exist. */
3490
- renameIfNotExists(
3491
- request: StorageRenameRequest,
3492
- context: CallContext & CallContextExt,
3493
- ): Promise<DeepPartial<StorageOperationResponse>>;
3494
- /** Generates a signed URL for an object that allows access without authentication. */
3495
- signedUrl(
3496
- request: StorageSignedUrlRequest,
3497
- context: CallContext & CallContextExt,
3498
- ): Promise<DeepPartial<StorageSignedUrlResponse>>;
3499
- }
3500
-
3501
- export interface StorageServiceClient<CallOptionsExt = {}> {
3502
- /**
3503
- * Retrieves data for a given object in a storage binding, with options.
3504
- * The first part of the stream will be GetResponsePart.Metadata, followed by GetResponsePart.ChunkData.
3505
- */
3506
- get(request: DeepPartial<StorageGetRequest>, options?: CallOptions & CallOptionsExt): AsyncIterable<GetResponsePart>;
3507
- /**
3508
- * Uploads data to a storage binding using a stream.
3509
- * The first chunk in the stream must be metadata including PutMultipartOptions.
3510
- */
3511
- putMultipart(
3512
- request: AsyncIterable<DeepPartial<StoragePutMultipartChunkRequest>>,
3513
- options?: CallOptions & CallOptionsExt,
3514
- ): Promise<StoragePutResponse>;
3515
- /** Uploads data to a storage binding in a single message, with PutOptions. */
3516
- put(request: DeepPartial<StoragePutRequest>, options?: CallOptions & CallOptionsExt): Promise<StoragePutResponse>;
3517
- /** Deletes an object from a storage binding. */
3518
- delete(
3519
- request: DeepPartial<StorageDeleteRequest>,
3520
- options?: CallOptions & CallOptionsExt,
3521
- ): Promise<StorageOperationResponse>;
3522
- /**
3523
- * Lists objects in a storage binding, optionally filtered by a prefix and offset.
3524
- * Returns a stream of object metadata.
3525
- */
3526
- list(
3527
- request: DeepPartial<StorageListRequest>,
3528
- options?: CallOptions & CallOptionsExt,
3529
- ): AsyncIterable<StorageObjectMeta>;
3530
- /** Lists objects and common prefixes (directories) with a delimiter. */
3531
- listWithDelimiter(
3532
- request: DeepPartial<StorageListWithDelimiterRequest>,
3533
- options?: CallOptions & CallOptionsExt,
3534
- ): Promise<StorageListResultProto>;
3535
- /** Retrieves metadata for an object in a storage binding. */
3536
- head(request: DeepPartial<StorageHeadRequest>, options?: CallOptions & CallOptionsExt): Promise<StorageObjectMeta>;
3537
- /** Gets the base directory path for a storage binding. */
3538
- getBaseDir(
3539
- request: DeepPartial<StorageGetBaseDirRequest>,
3540
- options?: CallOptions & CallOptionsExt,
3541
- ): Promise<StorageGetBaseDirResponse>;
3542
- /** Gets the underlying URL for a storage binding. */
3543
- getUrl(
3544
- request: DeepPartial<StorageGetUrlRequest>,
3545
- options?: CallOptions & CallOptionsExt,
3546
- ): Promise<StorageGetUrlResponse>;
3547
- /** Copies an object within the same storage binding. */
3548
- copy(
3549
- request: DeepPartial<StorageCopyRequest>,
3550
- options?: CallOptions & CallOptionsExt,
3551
- ): Promise<StorageOperationResponse>;
3552
- /** Renames (moves) an object within the same storage binding. */
3553
- rename(
3554
- request: DeepPartial<StorageRenameRequest>,
3555
- options?: CallOptions & CallOptionsExt,
3556
- ): Promise<StorageOperationResponse>;
3557
- /** Copies an object if the destination does not exist. */
3558
- copyIfNotExists(
3559
- request: DeepPartial<StorageCopyRequest>,
3560
- options?: CallOptions & CallOptionsExt,
3561
- ): Promise<StorageOperationResponse>;
3562
- /** Renames (moves) an object if the destination does not exist. */
3563
- renameIfNotExists(
3564
- request: DeepPartial<StorageRenameRequest>,
3565
- options?: CallOptions & CallOptionsExt,
3566
- ): Promise<StorageOperationResponse>;
3567
- /** Generates a signed URL for an object that allows access without authentication. */
3568
- signedUrl(
3569
- request: DeepPartial<StorageSignedUrlRequest>,
3570
- options?: CallOptions & CallOptionsExt,
3571
- ): Promise<StorageSignedUrlResponse>;
3572
- }
3573
-
3574
- function bytesFromBase64(b64: string): Uint8Array {
3575
- if ((globalThis as any).Buffer) {
3576
- return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
3577
- } else {
3578
- const bin = globalThis.atob(b64);
3579
- const arr = new Uint8Array(bin.length);
3580
- for (let i = 0; i < bin.length; ++i) {
3581
- arr[i] = bin.charCodeAt(i);
3582
- }
3583
- return arr;
3584
- }
3585
- }
3586
-
3587
- function base64FromBytes(arr: Uint8Array): string {
3588
- if ((globalThis as any).Buffer) {
3589
- return globalThis.Buffer.from(arr).toString("base64");
3590
- } else {
3591
- const bin: string[] = [];
3592
- arr.forEach((byte) => {
3593
- bin.push(globalThis.String.fromCharCode(byte));
3594
- });
3595
- return globalThis.btoa(bin.join(""));
3596
- }
3597
- }
3598
-
3599
- type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
3600
-
3601
- export type DeepPartial<T> = T extends Builtin ? T
3602
- : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
3603
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
3604
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
3605
- : Partial<T>;
3606
-
3607
- function toTimestamp(date: Date): Timestamp {
3608
- const seconds = Math.trunc(date.getTime() / 1_000);
3609
- const nanos = (date.getTime() % 1_000) * 1_000_000;
3610
- return { seconds, nanos };
3611
- }
3612
-
3613
- function fromTimestamp(t: Timestamp): Date {
3614
- let millis = (t.seconds || 0) * 1_000;
3615
- millis += (t.nanos || 0) / 1_000_000;
3616
- return new globalThis.Date(millis);
3617
- }
3618
-
3619
- function fromJsonTimestamp(o: any): Date {
3620
- if (o instanceof globalThis.Date) {
3621
- return o;
3622
- } else if (typeof o === "string") {
3623
- return new globalThis.Date(o);
3624
- } else {
3625
- return fromTimestamp(Timestamp.fromJSON(o));
3626
- }
3627
- }
3628
-
3629
- function longToNumber(int64: { toString(): string }): number {
3630
- const num = globalThis.Number(int64.toString());
3631
- if (num > globalThis.Number.MAX_SAFE_INTEGER) {
3632
- throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
3633
- }
3634
- if (num < globalThis.Number.MIN_SAFE_INTEGER) {
3635
- throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
3636
- }
3637
- return num;
3638
- }
3639
-
3640
- function isSet(value: any): boolean {
3641
- return value !== null && value !== undefined;
3642
- }
3643
-
3644
- export type ServerStreamingMethodResult<Response> = { [Symbol.asyncIterator](): AsyncIterator<Response, void> };
3645
-
3646
- export interface MessageFns<T> {
3647
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
3648
- decode(input: BinaryReader | Uint8Array, length?: number): T;
3649
- fromJSON(object: any): T;
3650
- toJSON(message: T): unknown;
3651
- create(base?: DeepPartial<T>): T;
3652
- fromPartial(object: DeepPartial<T>): T;
3653
- }