quiver-protobuf-typescript 1.0.1787789331 → 1.0.1787790308

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.
@@ -21,6 +21,11 @@ export interface CourierJobConsignment {
21
21
  qrCodeUrls: string[];
22
22
  courierId?: number | undefined;
23
23
  actionType: ActionType;
24
+ /**
25
+ * The estimated packed volume captured when this consignment is routed.
26
+ * Omitted means no saved dimensions were available, never zero volume.
27
+ */
28
+ volumeLitres?: number | undefined;
24
29
  }
25
30
 
26
31
  export interface CourierJobLineItem {
@@ -36,6 +41,7 @@ export interface CreateConsignmentRequest {
36
41
  lineItems: CreateLineItemRequest[];
37
42
  qrCodeUrls: string[];
38
43
  actionType?: ActionType | undefined;
44
+ volumeLitres?: number | undefined;
39
45
  }
40
46
 
41
47
  export interface CreateLineItemRequest {
@@ -76,6 +82,7 @@ function createBaseCourierJobConsignment(): CourierJobConsignment {
76
82
  qrCodeUrls: [],
77
83
  courierId: undefined,
78
84
  actionType: ActionType.ACTION_TYPE_UNSPECIFIED,
85
+ volumeLitres: undefined,
79
86
  };
80
87
  }
81
88
 
@@ -111,6 +118,9 @@ export const CourierJobConsignment: MessageFns<CourierJobConsignment> = {
111
118
  if (message.actionType !== ActionType.ACTION_TYPE_UNSPECIFIED) {
112
119
  writer.uint32(80).int32(actionTypeToNumber(message.actionType));
113
120
  }
121
+ if (message.volumeLitres !== undefined) {
122
+ writer.uint32(89).double(message.volumeLitres);
123
+ }
114
124
  return writer;
115
125
  },
116
126
 
@@ -207,6 +217,14 @@ export const CourierJobConsignment: MessageFns<CourierJobConsignment> = {
207
217
  message.actionType = actionTypeFromJSON(reader.int32());
208
218
  continue;
209
219
  }
220
+ case 11: {
221
+ if (tag !== 89) {
222
+ break;
223
+ }
224
+
225
+ message.volumeLitres = reader.double();
226
+ continue;
227
+ }
210
228
  }
211
229
  if ((tag & 7) === 4 || tag === 0) {
212
230
  break;
@@ -271,6 +289,11 @@ export const CourierJobConsignment: MessageFns<CourierJobConsignment> = {
271
289
  : isSet(object.action_type)
272
290
  ? actionTypeFromJSON(object.action_type)
273
291
  : ActionType.ACTION_TYPE_UNSPECIFIED,
292
+ volumeLitres: isSet(object.volumeLitres)
293
+ ? globalThis.Number(object.volumeLitres)
294
+ : isSet(object.volume_litres)
295
+ ? globalThis.Number(object.volume_litres)
296
+ : undefined,
274
297
  };
275
298
  },
276
299
 
@@ -306,6 +329,9 @@ export const CourierJobConsignment: MessageFns<CourierJobConsignment> = {
306
329
  if (message.actionType !== ActionType.ACTION_TYPE_UNSPECIFIED) {
307
330
  obj.actionType = actionTypeToJSON(message.actionType);
308
331
  }
332
+ if (message.volumeLitres !== undefined) {
333
+ obj.volumeLitres = message.volumeLitres;
334
+ }
309
335
  return obj;
310
336
  },
311
337
 
@@ -324,6 +350,7 @@ export const CourierJobConsignment: MessageFns<CourierJobConsignment> = {
324
350
  message.qrCodeUrls = object.qrCodeUrls?.map((e) => e) || [];
325
351
  message.courierId = object.courierId ?? undefined;
326
352
  message.actionType = object.actionType ?? ActionType.ACTION_TYPE_UNSPECIFIED;
353
+ message.volumeLitres = object.volumeLitres ?? undefined;
327
354
  return message;
328
355
  },
329
356
  };
@@ -422,6 +449,7 @@ function createBaseCreateConsignmentRequest(): CreateConsignmentRequest {
422
449
  lineItems: [],
423
450
  qrCodeUrls: [],
424
451
  actionType: undefined,
452
+ volumeLitres: undefined,
425
453
  };
426
454
  }
427
455
 
@@ -448,6 +476,9 @@ export const CreateConsignmentRequest: MessageFns<CreateConsignmentRequest> = {
448
476
  if (message.actionType !== undefined) {
449
477
  writer.uint32(56).int32(actionTypeToNumber(message.actionType));
450
478
  }
479
+ if (message.volumeLitres !== undefined) {
480
+ writer.uint32(65).double(message.volumeLitres);
481
+ }
451
482
  return writer;
452
483
  },
453
484
 
@@ -520,6 +551,14 @@ export const CreateConsignmentRequest: MessageFns<CreateConsignmentRequest> = {
520
551
  message.actionType = actionTypeFromJSON(reader.int32());
521
552
  continue;
522
553
  }
554
+ case 8: {
555
+ if (tag !== 65) {
556
+ break;
557
+ }
558
+
559
+ message.volumeLitres = reader.double();
560
+ continue;
561
+ }
523
562
  }
524
563
  if ((tag & 7) === 4 || tag === 0) {
525
564
  break;
@@ -569,6 +608,11 @@ export const CreateConsignmentRequest: MessageFns<CreateConsignmentRequest> = {
569
608
  : isSet(object.action_type)
570
609
  ? actionTypeFromJSON(object.action_type)
571
610
  : undefined,
611
+ volumeLitres: isSet(object.volumeLitres)
612
+ ? globalThis.Number(object.volumeLitres)
613
+ : isSet(object.volume_litres)
614
+ ? globalThis.Number(object.volume_litres)
615
+ : undefined,
572
616
  };
573
617
  },
574
618
 
@@ -595,6 +639,9 @@ export const CreateConsignmentRequest: MessageFns<CreateConsignmentRequest> = {
595
639
  if (message.actionType !== undefined) {
596
640
  obj.actionType = actionTypeToJSON(message.actionType);
597
641
  }
642
+ if (message.volumeLitres !== undefined) {
643
+ obj.volumeLitres = message.volumeLitres;
644
+ }
598
645
  return obj;
599
646
  },
600
647
 
@@ -610,6 +657,7 @@ export const CreateConsignmentRequest: MessageFns<CreateConsignmentRequest> = {
610
657
  message.lineItems = object.lineItems?.map((e) => CreateLineItemRequest.fromPartial(e)) || [];
611
658
  message.qrCodeUrls = object.qrCodeUrls?.map((e) => e) || [];
612
659
  message.actionType = object.actionType ?? undefined;
660
+ message.volumeLitres = object.volumeLitres ?? undefined;
613
661
  return message;
614
662
  },
615
663
  };
@@ -100,6 +100,22 @@ export interface Courier {
100
100
  defaultVehicleId?: number | undefined;
101
101
  numberOfShifts?: number | undefined;
102
102
  homeAddress?: Address | undefined;
103
+ capacityLoad?: CourierCapacityLoad | undefined;
104
+ }
105
+
106
+ /**
107
+ * Current and planned load for the courier's vehicle selected for this shift.
108
+ * `*_unknown` means at least one relevant consignment has no saved dimensions,
109
+ * so clients must not present a misleading percentage as complete.
110
+ */
111
+ export interface CourierCapacityLoad {
112
+ courierVehicleId?: number | undefined;
113
+ vehicleName?: string | undefined;
114
+ capacityLitres?: number | undefined;
115
+ currentVolumeLitres: number;
116
+ projectedPeakVolumeLitres: number;
117
+ currentUnknown: boolean;
118
+ projectedUnknown: boolean;
103
119
  }
104
120
 
105
121
  export interface CourierPaymentDetails {
@@ -232,6 +248,7 @@ function createBaseCourier(): Courier {
232
248
  defaultVehicleId: undefined,
233
249
  numberOfShifts: undefined,
234
250
  homeAddress: undefined,
251
+ capacityLoad: undefined,
235
252
  };
236
253
  }
237
254
 
@@ -291,6 +308,9 @@ export const Courier: MessageFns<Courier> = {
291
308
  if (message.homeAddress !== undefined) {
292
309
  Address.encode(message.homeAddress, writer.uint32(146).fork()).join();
293
310
  }
311
+ if (message.capacityLoad !== undefined) {
312
+ CourierCapacityLoad.encode(message.capacityLoad, writer.uint32(154).fork()).join();
313
+ }
294
314
  return writer;
295
315
  },
296
316
 
@@ -451,6 +471,14 @@ export const Courier: MessageFns<Courier> = {
451
471
  message.homeAddress = Address.decode(reader, reader.uint32());
452
472
  continue;
453
473
  }
474
+ case 19: {
475
+ if (tag !== 154) {
476
+ break;
477
+ }
478
+
479
+ message.capacityLoad = CourierCapacityLoad.decode(reader, reader.uint32());
480
+ continue;
481
+ }
454
482
  }
455
483
  if ((tag & 7) === 4 || tag === 0) {
456
484
  break;
@@ -523,6 +551,11 @@ export const Courier: MessageFns<Courier> = {
523
551
  : isSet(object.home_address)
524
552
  ? Address.fromJSON(object.home_address)
525
553
  : undefined,
554
+ capacityLoad: isSet(object.capacityLoad)
555
+ ? CourierCapacityLoad.fromJSON(object.capacityLoad)
556
+ : isSet(object.capacity_load)
557
+ ? CourierCapacityLoad.fromJSON(object.capacity_load)
558
+ : undefined,
526
559
  };
527
560
  },
528
561
 
@@ -582,6 +615,9 @@ export const Courier: MessageFns<Courier> = {
582
615
  if (message.homeAddress !== undefined) {
583
616
  obj.homeAddress = Address.toJSON(message.homeAddress);
584
617
  }
618
+ if (message.capacityLoad !== undefined) {
619
+ obj.capacityLoad = CourierCapacityLoad.toJSON(message.capacityLoad);
620
+ }
585
621
  return obj;
586
622
  },
587
623
 
@@ -614,6 +650,210 @@ export const Courier: MessageFns<Courier> = {
614
650
  message.homeAddress = (object.homeAddress !== undefined && object.homeAddress !== null)
615
651
  ? Address.fromPartial(object.homeAddress)
616
652
  : undefined;
653
+ message.capacityLoad = (object.capacityLoad !== undefined && object.capacityLoad !== null)
654
+ ? CourierCapacityLoad.fromPartial(object.capacityLoad)
655
+ : undefined;
656
+ return message;
657
+ },
658
+ };
659
+
660
+ function createBaseCourierCapacityLoad(): CourierCapacityLoad {
661
+ return {
662
+ courierVehicleId: undefined,
663
+ vehicleName: undefined,
664
+ capacityLitres: undefined,
665
+ currentVolumeLitres: 0,
666
+ projectedPeakVolumeLitres: 0,
667
+ currentUnknown: false,
668
+ projectedUnknown: false,
669
+ };
670
+ }
671
+
672
+ export const CourierCapacityLoad: MessageFns<CourierCapacityLoad> = {
673
+ encode(message: CourierCapacityLoad, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
674
+ if (message.courierVehicleId !== undefined) {
675
+ writer.uint32(8).int32(message.courierVehicleId);
676
+ }
677
+ if (message.vehicleName !== undefined) {
678
+ writer.uint32(18).string(message.vehicleName);
679
+ }
680
+ if (message.capacityLitres !== undefined) {
681
+ writer.uint32(25).double(message.capacityLitres);
682
+ }
683
+ if (message.currentVolumeLitres !== 0) {
684
+ writer.uint32(33).double(message.currentVolumeLitres);
685
+ }
686
+ if (message.projectedPeakVolumeLitres !== 0) {
687
+ writer.uint32(41).double(message.projectedPeakVolumeLitres);
688
+ }
689
+ if (message.currentUnknown !== false) {
690
+ writer.uint32(48).bool(message.currentUnknown);
691
+ }
692
+ if (message.projectedUnknown !== false) {
693
+ writer.uint32(56).bool(message.projectedUnknown);
694
+ }
695
+ return writer;
696
+ },
697
+
698
+ decode(input: BinaryReader | Uint8Array, length?: number): CourierCapacityLoad {
699
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
700
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
701
+ if (previousRecursionDepth >= 100) {
702
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
703
+ }
704
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
705
+ try {
706
+ const end = length === undefined ? reader.len : reader.pos + length;
707
+ const message = createBaseCourierCapacityLoad();
708
+ while (reader.pos < end) {
709
+ const tag = reader.uint32();
710
+ switch (tag >>> 3) {
711
+ case 1: {
712
+ if (tag !== 8) {
713
+ break;
714
+ }
715
+
716
+ message.courierVehicleId = reader.int32();
717
+ continue;
718
+ }
719
+ case 2: {
720
+ if (tag !== 18) {
721
+ break;
722
+ }
723
+
724
+ message.vehicleName = reader.string();
725
+ continue;
726
+ }
727
+ case 3: {
728
+ if (tag !== 25) {
729
+ break;
730
+ }
731
+
732
+ message.capacityLitres = reader.double();
733
+ continue;
734
+ }
735
+ case 4: {
736
+ if (tag !== 33) {
737
+ break;
738
+ }
739
+
740
+ message.currentVolumeLitres = reader.double();
741
+ continue;
742
+ }
743
+ case 5: {
744
+ if (tag !== 41) {
745
+ break;
746
+ }
747
+
748
+ message.projectedPeakVolumeLitres = reader.double();
749
+ continue;
750
+ }
751
+ case 6: {
752
+ if (tag !== 48) {
753
+ break;
754
+ }
755
+
756
+ message.currentUnknown = reader.bool();
757
+ continue;
758
+ }
759
+ case 7: {
760
+ if (tag !== 56) {
761
+ break;
762
+ }
763
+
764
+ message.projectedUnknown = reader.bool();
765
+ continue;
766
+ }
767
+ }
768
+ if ((tag & 7) === 4 || tag === 0) {
769
+ break;
770
+ }
771
+ reader.skip(tag & 7);
772
+ }
773
+ return message;
774
+ } finally {
775
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
776
+ }
777
+ },
778
+
779
+ fromJSON(object: any): CourierCapacityLoad {
780
+ return {
781
+ courierVehicleId: isSet(object.courierVehicleId)
782
+ ? globalThis.Number(object.courierVehicleId)
783
+ : isSet(object.courier_vehicle_id)
784
+ ? globalThis.Number(object.courier_vehicle_id)
785
+ : undefined,
786
+ vehicleName: isSet(object.vehicleName)
787
+ ? globalThis.String(object.vehicleName)
788
+ : isSet(object.vehicle_name)
789
+ ? globalThis.String(object.vehicle_name)
790
+ : undefined,
791
+ capacityLitres: isSet(object.capacityLitres)
792
+ ? globalThis.Number(object.capacityLitres)
793
+ : isSet(object.capacity_litres)
794
+ ? globalThis.Number(object.capacity_litres)
795
+ : undefined,
796
+ currentVolumeLitres: isSet(object.currentVolumeLitres)
797
+ ? globalThis.Number(object.currentVolumeLitres)
798
+ : isSet(object.current_volume_litres)
799
+ ? globalThis.Number(object.current_volume_litres)
800
+ : 0,
801
+ projectedPeakVolumeLitres: isSet(object.projectedPeakVolumeLitres)
802
+ ? globalThis.Number(object.projectedPeakVolumeLitres)
803
+ : isSet(object.projected_peak_volume_litres)
804
+ ? globalThis.Number(object.projected_peak_volume_litres)
805
+ : 0,
806
+ currentUnknown: isSet(object.currentUnknown)
807
+ ? globalThis.Boolean(object.currentUnknown)
808
+ : isSet(object.current_unknown)
809
+ ? globalThis.Boolean(object.current_unknown)
810
+ : false,
811
+ projectedUnknown: isSet(object.projectedUnknown)
812
+ ? globalThis.Boolean(object.projectedUnknown)
813
+ : isSet(object.projected_unknown)
814
+ ? globalThis.Boolean(object.projected_unknown)
815
+ : false,
816
+ };
817
+ },
818
+
819
+ toJSON(message: CourierCapacityLoad): unknown {
820
+ const obj: any = {};
821
+ if (message.courierVehicleId !== undefined) {
822
+ obj.courierVehicleId = Math.round(message.courierVehicleId);
823
+ }
824
+ if (message.vehicleName !== undefined) {
825
+ obj.vehicleName = message.vehicleName;
826
+ }
827
+ if (message.capacityLitres !== undefined) {
828
+ obj.capacityLitres = message.capacityLitres;
829
+ }
830
+ if (message.currentVolumeLitres !== 0) {
831
+ obj.currentVolumeLitres = message.currentVolumeLitres;
832
+ }
833
+ if (message.projectedPeakVolumeLitres !== 0) {
834
+ obj.projectedPeakVolumeLitres = message.projectedPeakVolumeLitres;
835
+ }
836
+ if (message.currentUnknown !== false) {
837
+ obj.currentUnknown = message.currentUnknown;
838
+ }
839
+ if (message.projectedUnknown !== false) {
840
+ obj.projectedUnknown = message.projectedUnknown;
841
+ }
842
+ return obj;
843
+ },
844
+
845
+ create<I extends Exact<DeepPartial<CourierCapacityLoad>, I>>(base?: I): CourierCapacityLoad {
846
+ return CourierCapacityLoad.fromPartial(base ?? ({} as any));
847
+ },
848
+ fromPartial<I extends Exact<DeepPartial<CourierCapacityLoad>, I>>(object: I): CourierCapacityLoad {
849
+ const message = createBaseCourierCapacityLoad();
850
+ message.courierVehicleId = object.courierVehicleId ?? undefined;
851
+ message.vehicleName = object.vehicleName ?? undefined;
852
+ message.capacityLitres = object.capacityLitres ?? undefined;
853
+ message.currentVolumeLitres = object.currentVolumeLitres ?? 0;
854
+ message.projectedPeakVolumeLitres = object.projectedPeakVolumeLitres ?? 0;
855
+ message.currentUnknown = object.currentUnknown ?? false;
856
+ message.projectedUnknown = object.projectedUnknown ?? false;
617
857
  return message;
618
858
  },
619
859
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quiver-protobuf-typescript",
3
- "version": "1.0.1787789331",
3
+ "version": "1.0.1787790308",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",