@vectora/contracts 1.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.
- package/LICENSE.md +25 -0
- package/dist/events/auth/index.d.ts +1 -0
- package/dist/events/auth/index.js +17 -0
- package/dist/events/auth/verification-request.interface.d.ts +5 -0
- package/dist/events/auth/verification-request.interface.js +2 -0
- package/dist/events/index.d.ts +1 -0
- package/dist/events/index.js +17 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +19 -0
- package/dist/proto/index.d.ts +1 -0
- package/dist/proto/index.js +17 -0
- package/dist/proto/paths.d.ts +18 -0
- package/dist/proto/paths.js +27 -0
- package/dist/utils/data-transformer.util.d.ts +55 -0
- package/dist/utils/data-transformer.util.js +141 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +17 -0
- package/gen/go/mapbox-direction-v1.pb.go +621 -0
- package/gen/go/mapbox-geocode-v1.pb.go +473 -0
- package/gen/go/mapbox-matrix-v1.pb.go +337 -0
- package/gen/go/mapbox-optimization-v1.pb.go +422 -0
- package/gen/go/mapbox-search-v1.pb.go +699 -0
- package/gen/ts/common-geocode-v1.ts +368 -0
- package/gen/ts/common-pagination-v1.ts +713 -0
- package/gen/ts/fleet-truck-v1.ts +1102 -0
- package/gen/ts/fleet-unit-v1.ts +9 -0
- package/gen/ts/google/protobuf/field_mask.ts +295 -0
- package/gen/ts/google/protobuf/wrappers.ts +544 -0
- package/gen/ts/identify-account-v1.ts +9 -0
- package/gen/ts/identify-auth-v1.ts +9 -0
- package/gen/ts/identify-company-v1.ts +1025 -0
- package/gen/ts/identify-role-v1.ts +9 -0
- package/gen/ts/identify-user-v1.ts +9 -0
- package/gen/ts/mapbox-direction-v1.ts +718 -0
- package/gen/ts/mapbox-geocode-v1.ts +511 -0
- package/gen/ts/mapbox-matrix-v1.ts +369 -0
- package/gen/ts/mapbox-optimization-v1.ts +472 -0
- package/gen/ts/mapbox-search-v1.ts +803 -0
- package/gen/ts/shipments-freight-v1.ts +9 -0
- package/gen/ts/shipments-loads-v1.ts +9 -0
- package/gen/ts/shipments-rate-v1.ts +9 -0
- package/gen/ts/shipments-stop-v1.ts +9 -0
- package/package.json +40 -0
- package/proto/common-geocode-v1.proto +10 -0
- package/proto/common-pagination-v1.proto +39 -0
- package/proto/fleet-truck-v1.proto +145 -0
- package/proto/fleet-unit-v1.proto +3 -0
- package/proto/identify-account-v1.proto +3 -0
- package/proto/identify-auth-v1.proto +3 -0
- package/proto/identify-company-v1.proto +114 -0
- package/proto/identify-role-v1.proto +3 -0
- package/proto/identify-user-v1.proto +3 -0
- package/proto/mapbox-direction-v1.proto +61 -0
- package/proto/mapbox-geocode-v1.proto +47 -0
- package/proto/mapbox-matrix-v1.proto +34 -0
- package/proto/mapbox-optimization-v1.proto +43 -0
- package/proto/mapbox-search-v1.proto +68 -0
- package/proto/shipments-freight-v1.proto +3 -0
- package/proto/shipments-loads-v1.proto +3 -0
- package/proto/shipments-rate-v1.proto +3 -0
- package/proto/shipments-stop-v1.proto +3 -0
|
@@ -0,0 +1,1102 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.2
|
|
4
|
+
// protoc v3.21.12
|
|
5
|
+
// source: fleet-truck-v1.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
9
|
+
import { FilterQuery, PaginateMeta, PaginateQuery } from "./common-pagination-v1";
|
|
10
|
+
import { FieldMask } from "./google/protobuf/field_mask";
|
|
11
|
+
import { Int32Value, StringValue } from "./google/protobuf/wrappers";
|
|
12
|
+
|
|
13
|
+
export const protobufPackage = "truck.v1";
|
|
14
|
+
|
|
15
|
+
export enum TruckDock {
|
|
16
|
+
TRUCK_DOCK_UNSPECIFIED = 0,
|
|
17
|
+
TRUCK_DOCK_NO = 1,
|
|
18
|
+
TRUCK_DOCK_RA = 2,
|
|
19
|
+
TRUCK_DOCK_LG = 3,
|
|
20
|
+
TRUCK_DOCK_TR = 4,
|
|
21
|
+
UNRECOGNIZED = -1,
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export enum TruckType {
|
|
25
|
+
TRUCK_TYPE_UNSPECIFIED = 0,
|
|
26
|
+
TRUCK_TYPE_CV = 1,
|
|
27
|
+
TRUCK_TYPE_SV = 2,
|
|
28
|
+
TRUCK_TYPE_SV_REF = 3,
|
|
29
|
+
TRUCK_TYPE_SS = 4,
|
|
30
|
+
TRUCK_TYPE_SS_REF = 5,
|
|
31
|
+
TRUCK_TYPE_LS = 6,
|
|
32
|
+
TRUCK_TYPE_LS_REF = 7,
|
|
33
|
+
UNRECOGNIZED = -1,
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export enum TruckEquipment {
|
|
37
|
+
TRUCK_EQUIPMENT_UNSPECIFIED = 0,
|
|
38
|
+
/** TRUCK_EQUIPMENT_LG - Liftgate */
|
|
39
|
+
TRUCK_EQUIPMENT_LG = 1,
|
|
40
|
+
/** TRUCK_EQUIPMENT_PJ - Pallet Jack */
|
|
41
|
+
TRUCK_EQUIPMENT_PJ = 2,
|
|
42
|
+
/** TRUCK_EQUIPMENT_AR - Air Ride */
|
|
43
|
+
TRUCK_EQUIPMENT_AR = 3,
|
|
44
|
+
/** TRUCK_EQUIPMENT_DL - Dolly */
|
|
45
|
+
TRUCK_EQUIPMENT_DL = 4,
|
|
46
|
+
/** TRUCK_EQUIPMENT_ST - Straps */
|
|
47
|
+
TRUCK_EQUIPMENT_ST = 5,
|
|
48
|
+
/** TRUCK_EQUIPMENT_BL - Blankets */
|
|
49
|
+
TRUCK_EQUIPMENT_BL = 6,
|
|
50
|
+
/** TRUCK_EQUIPMENT_LB - Load Bars */
|
|
51
|
+
TRUCK_EQUIPMENT_LB = 7,
|
|
52
|
+
/** TRUCK_EQUIPMENT_TP - Tarps */
|
|
53
|
+
TRUCK_EQUIPMENT_TP = 8,
|
|
54
|
+
/** TRUCK_EQUIPMENT_ETW - Walls E-Track */
|
|
55
|
+
TRUCK_EQUIPMENT_ETW = 9,
|
|
56
|
+
/** TRUCK_EQUIPMENT_FTW - Floor E-Track */
|
|
57
|
+
TRUCK_EQUIPMENT_FTW = 10,
|
|
58
|
+
UNRECOGNIZED = -1,
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface CreateTruckRequest {
|
|
62
|
+
make: string;
|
|
63
|
+
model: string;
|
|
64
|
+
year: number | undefined;
|
|
65
|
+
vin: string;
|
|
66
|
+
plate: string | undefined;
|
|
67
|
+
plateState: string | undefined;
|
|
68
|
+
length: number;
|
|
69
|
+
width: number;
|
|
70
|
+
height: number;
|
|
71
|
+
doorWidth: number;
|
|
72
|
+
doorHeight: number;
|
|
73
|
+
capacity: number;
|
|
74
|
+
dockHigh: TruckDock;
|
|
75
|
+
type: TruckType;
|
|
76
|
+
equipment?: CreateTruckRequest_EquipmentInput | undefined;
|
|
77
|
+
company: string;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** Wrapper for equipment to distinguish null (not received) from [] (clear) */
|
|
81
|
+
export interface CreateTruckRequest_EquipmentInput {
|
|
82
|
+
items: TruckEquipment[];
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export interface UpdateTruckRequest {
|
|
86
|
+
/** Inside the truck, the id must be filled in. */
|
|
87
|
+
truck:
|
|
88
|
+
| TruckResponse
|
|
89
|
+
| undefined;
|
|
90
|
+
/** The mask determines which fields from truck we save in the database. */
|
|
91
|
+
updateMask: string[] | undefined;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export interface TruckResponse {
|
|
95
|
+
id: string;
|
|
96
|
+
make: string;
|
|
97
|
+
model: string;
|
|
98
|
+
year: number | undefined;
|
|
99
|
+
vin: string;
|
|
100
|
+
plate: string | undefined;
|
|
101
|
+
plateState: string | undefined;
|
|
102
|
+
length: number;
|
|
103
|
+
width: number;
|
|
104
|
+
height: number;
|
|
105
|
+
doorWidth: number;
|
|
106
|
+
doorHeight: number;
|
|
107
|
+
capacity: number;
|
|
108
|
+
dockHigh: TruckDock;
|
|
109
|
+
type: TruckType;
|
|
110
|
+
equipment: TruckEquipment[];
|
|
111
|
+
company: string;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export interface GetOneTruckRequest {
|
|
115
|
+
id: string;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export interface TruckPaginatedResponse {
|
|
119
|
+
data: TruckResponse[];
|
|
120
|
+
meta: PaginateMeta | undefined;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export interface TruckNotPaginatedResponse {
|
|
124
|
+
data: TruckResponse[];
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export interface DeleteTruckRequest {
|
|
128
|
+
id: string;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export interface DeleteTruckResponse {
|
|
132
|
+
success: boolean;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function createBaseCreateTruckRequest(): CreateTruckRequest {
|
|
136
|
+
return {
|
|
137
|
+
make: "",
|
|
138
|
+
model: "",
|
|
139
|
+
year: undefined,
|
|
140
|
+
vin: "",
|
|
141
|
+
plate: undefined,
|
|
142
|
+
plateState: undefined,
|
|
143
|
+
length: 0,
|
|
144
|
+
width: 0,
|
|
145
|
+
height: 0,
|
|
146
|
+
doorWidth: 0,
|
|
147
|
+
doorHeight: 0,
|
|
148
|
+
capacity: 0,
|
|
149
|
+
dockHigh: 0,
|
|
150
|
+
type: 0,
|
|
151
|
+
equipment: undefined,
|
|
152
|
+
company: "",
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export const CreateTruckRequest: MessageFns<CreateTruckRequest> = {
|
|
157
|
+
encode(message: CreateTruckRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
158
|
+
if (message.make !== "") {
|
|
159
|
+
writer.uint32(10).string(message.make);
|
|
160
|
+
}
|
|
161
|
+
if (message.model !== "") {
|
|
162
|
+
writer.uint32(18).string(message.model);
|
|
163
|
+
}
|
|
164
|
+
if (message.year !== undefined) {
|
|
165
|
+
Int32Value.encode({ value: message.year! }, writer.uint32(26).fork()).join();
|
|
166
|
+
}
|
|
167
|
+
if (message.vin !== "") {
|
|
168
|
+
writer.uint32(34).string(message.vin);
|
|
169
|
+
}
|
|
170
|
+
if (message.plate !== undefined) {
|
|
171
|
+
StringValue.encode({ value: message.plate! }, writer.uint32(42).fork()).join();
|
|
172
|
+
}
|
|
173
|
+
if (message.plateState !== undefined) {
|
|
174
|
+
StringValue.encode({ value: message.plateState! }, writer.uint32(50).fork()).join();
|
|
175
|
+
}
|
|
176
|
+
if (message.length !== 0) {
|
|
177
|
+
writer.uint32(56).int32(message.length);
|
|
178
|
+
}
|
|
179
|
+
if (message.width !== 0) {
|
|
180
|
+
writer.uint32(64).int32(message.width);
|
|
181
|
+
}
|
|
182
|
+
if (message.height !== 0) {
|
|
183
|
+
writer.uint32(72).int32(message.height);
|
|
184
|
+
}
|
|
185
|
+
if (message.doorWidth !== 0) {
|
|
186
|
+
writer.uint32(80).int32(message.doorWidth);
|
|
187
|
+
}
|
|
188
|
+
if (message.doorHeight !== 0) {
|
|
189
|
+
writer.uint32(88).int32(message.doorHeight);
|
|
190
|
+
}
|
|
191
|
+
if (message.capacity !== 0) {
|
|
192
|
+
writer.uint32(96).int32(message.capacity);
|
|
193
|
+
}
|
|
194
|
+
if (message.dockHigh !== 0) {
|
|
195
|
+
writer.uint32(104).int32(message.dockHigh);
|
|
196
|
+
}
|
|
197
|
+
if (message.type !== 0) {
|
|
198
|
+
writer.uint32(112).int32(message.type);
|
|
199
|
+
}
|
|
200
|
+
if (message.equipment !== undefined) {
|
|
201
|
+
CreateTruckRequest_EquipmentInput.encode(message.equipment, writer.uint32(122).fork()).join();
|
|
202
|
+
}
|
|
203
|
+
if (message.company !== "") {
|
|
204
|
+
writer.uint32(130).string(message.company);
|
|
205
|
+
}
|
|
206
|
+
return writer;
|
|
207
|
+
},
|
|
208
|
+
|
|
209
|
+
decode(input: BinaryReader | Uint8Array, length?: number): CreateTruckRequest {
|
|
210
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
211
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
212
|
+
const message = createBaseCreateTruckRequest();
|
|
213
|
+
while (reader.pos < end) {
|
|
214
|
+
const tag = reader.uint32();
|
|
215
|
+
switch (tag >>> 3) {
|
|
216
|
+
case 1: {
|
|
217
|
+
if (tag !== 10) {
|
|
218
|
+
break;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
message.make = reader.string();
|
|
222
|
+
continue;
|
|
223
|
+
}
|
|
224
|
+
case 2: {
|
|
225
|
+
if (tag !== 18) {
|
|
226
|
+
break;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
message.model = reader.string();
|
|
230
|
+
continue;
|
|
231
|
+
}
|
|
232
|
+
case 3: {
|
|
233
|
+
if (tag !== 26) {
|
|
234
|
+
break;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
message.year = Int32Value.decode(reader, reader.uint32()).value;
|
|
238
|
+
continue;
|
|
239
|
+
}
|
|
240
|
+
case 4: {
|
|
241
|
+
if (tag !== 34) {
|
|
242
|
+
break;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
message.vin = reader.string();
|
|
246
|
+
continue;
|
|
247
|
+
}
|
|
248
|
+
case 5: {
|
|
249
|
+
if (tag !== 42) {
|
|
250
|
+
break;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
message.plate = StringValue.decode(reader, reader.uint32()).value;
|
|
254
|
+
continue;
|
|
255
|
+
}
|
|
256
|
+
case 6: {
|
|
257
|
+
if (tag !== 50) {
|
|
258
|
+
break;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
message.plateState = StringValue.decode(reader, reader.uint32()).value;
|
|
262
|
+
continue;
|
|
263
|
+
}
|
|
264
|
+
case 7: {
|
|
265
|
+
if (tag !== 56) {
|
|
266
|
+
break;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
message.length = reader.int32();
|
|
270
|
+
continue;
|
|
271
|
+
}
|
|
272
|
+
case 8: {
|
|
273
|
+
if (tag !== 64) {
|
|
274
|
+
break;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
message.width = reader.int32();
|
|
278
|
+
continue;
|
|
279
|
+
}
|
|
280
|
+
case 9: {
|
|
281
|
+
if (tag !== 72) {
|
|
282
|
+
break;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
message.height = reader.int32();
|
|
286
|
+
continue;
|
|
287
|
+
}
|
|
288
|
+
case 10: {
|
|
289
|
+
if (tag !== 80) {
|
|
290
|
+
break;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
message.doorWidth = reader.int32();
|
|
294
|
+
continue;
|
|
295
|
+
}
|
|
296
|
+
case 11: {
|
|
297
|
+
if (tag !== 88) {
|
|
298
|
+
break;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
message.doorHeight = reader.int32();
|
|
302
|
+
continue;
|
|
303
|
+
}
|
|
304
|
+
case 12: {
|
|
305
|
+
if (tag !== 96) {
|
|
306
|
+
break;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
message.capacity = reader.int32();
|
|
310
|
+
continue;
|
|
311
|
+
}
|
|
312
|
+
case 13: {
|
|
313
|
+
if (tag !== 104) {
|
|
314
|
+
break;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
message.dockHigh = reader.int32() as any;
|
|
318
|
+
continue;
|
|
319
|
+
}
|
|
320
|
+
case 14: {
|
|
321
|
+
if (tag !== 112) {
|
|
322
|
+
break;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
message.type = reader.int32() as any;
|
|
326
|
+
continue;
|
|
327
|
+
}
|
|
328
|
+
case 15: {
|
|
329
|
+
if (tag !== 122) {
|
|
330
|
+
break;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
message.equipment = CreateTruckRequest_EquipmentInput.decode(reader, reader.uint32());
|
|
334
|
+
continue;
|
|
335
|
+
}
|
|
336
|
+
case 16: {
|
|
337
|
+
if (tag !== 130) {
|
|
338
|
+
break;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
message.company = reader.string();
|
|
342
|
+
continue;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
346
|
+
break;
|
|
347
|
+
}
|
|
348
|
+
reader.skip(tag & 7);
|
|
349
|
+
}
|
|
350
|
+
return message;
|
|
351
|
+
},
|
|
352
|
+
|
|
353
|
+
create<I extends Exact<DeepPartial<CreateTruckRequest>, I>>(base?: I): CreateTruckRequest {
|
|
354
|
+
return CreateTruckRequest.fromPartial(base ?? ({} as any));
|
|
355
|
+
},
|
|
356
|
+
fromPartial<I extends Exact<DeepPartial<CreateTruckRequest>, I>>(object: I): CreateTruckRequest {
|
|
357
|
+
const message = createBaseCreateTruckRequest();
|
|
358
|
+
message.make = object.make ?? "";
|
|
359
|
+
message.model = object.model ?? "";
|
|
360
|
+
message.year = object.year ?? undefined;
|
|
361
|
+
message.vin = object.vin ?? "";
|
|
362
|
+
message.plate = object.plate ?? undefined;
|
|
363
|
+
message.plateState = object.plateState ?? undefined;
|
|
364
|
+
message.length = object.length ?? 0;
|
|
365
|
+
message.width = object.width ?? 0;
|
|
366
|
+
message.height = object.height ?? 0;
|
|
367
|
+
message.doorWidth = object.doorWidth ?? 0;
|
|
368
|
+
message.doorHeight = object.doorHeight ?? 0;
|
|
369
|
+
message.capacity = object.capacity ?? 0;
|
|
370
|
+
message.dockHigh = object.dockHigh ?? 0;
|
|
371
|
+
message.type = object.type ?? 0;
|
|
372
|
+
message.equipment = (object.equipment !== undefined && object.equipment !== null)
|
|
373
|
+
? CreateTruckRequest_EquipmentInput.fromPartial(object.equipment)
|
|
374
|
+
: undefined;
|
|
375
|
+
message.company = object.company ?? "";
|
|
376
|
+
return message;
|
|
377
|
+
},
|
|
378
|
+
};
|
|
379
|
+
|
|
380
|
+
function createBaseCreateTruckRequest_EquipmentInput(): CreateTruckRequest_EquipmentInput {
|
|
381
|
+
return { items: [] };
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
export const CreateTruckRequest_EquipmentInput: MessageFns<CreateTruckRequest_EquipmentInput> = {
|
|
385
|
+
encode(message: CreateTruckRequest_EquipmentInput, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
386
|
+
writer.uint32(10).fork();
|
|
387
|
+
for (const v of message.items) {
|
|
388
|
+
writer.int32(v);
|
|
389
|
+
}
|
|
390
|
+
writer.join();
|
|
391
|
+
return writer;
|
|
392
|
+
},
|
|
393
|
+
|
|
394
|
+
decode(input: BinaryReader | Uint8Array, length?: number): CreateTruckRequest_EquipmentInput {
|
|
395
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
396
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
397
|
+
const message = createBaseCreateTruckRequest_EquipmentInput();
|
|
398
|
+
while (reader.pos < end) {
|
|
399
|
+
const tag = reader.uint32();
|
|
400
|
+
switch (tag >>> 3) {
|
|
401
|
+
case 1: {
|
|
402
|
+
if (tag === 8) {
|
|
403
|
+
message.items.push(reader.int32() as any);
|
|
404
|
+
|
|
405
|
+
continue;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
if (tag === 10) {
|
|
409
|
+
const end2 = reader.uint32() + reader.pos;
|
|
410
|
+
while (reader.pos < end2) {
|
|
411
|
+
message.items.push(reader.int32() as any);
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
continue;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
break;
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
421
|
+
break;
|
|
422
|
+
}
|
|
423
|
+
reader.skip(tag & 7);
|
|
424
|
+
}
|
|
425
|
+
return message;
|
|
426
|
+
},
|
|
427
|
+
|
|
428
|
+
create<I extends Exact<DeepPartial<CreateTruckRequest_EquipmentInput>, I>>(
|
|
429
|
+
base?: I,
|
|
430
|
+
): CreateTruckRequest_EquipmentInput {
|
|
431
|
+
return CreateTruckRequest_EquipmentInput.fromPartial(base ?? ({} as any));
|
|
432
|
+
},
|
|
433
|
+
fromPartial<I extends Exact<DeepPartial<CreateTruckRequest_EquipmentInput>, I>>(
|
|
434
|
+
object: I,
|
|
435
|
+
): CreateTruckRequest_EquipmentInput {
|
|
436
|
+
const message = createBaseCreateTruckRequest_EquipmentInput();
|
|
437
|
+
message.items = object.items?.map((e) => e) || [];
|
|
438
|
+
return message;
|
|
439
|
+
},
|
|
440
|
+
};
|
|
441
|
+
|
|
442
|
+
function createBaseUpdateTruckRequest(): UpdateTruckRequest {
|
|
443
|
+
return { truck: undefined, updateMask: undefined };
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
export const UpdateTruckRequest: MessageFns<UpdateTruckRequest> = {
|
|
447
|
+
encode(message: UpdateTruckRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
448
|
+
if (message.truck !== undefined) {
|
|
449
|
+
TruckResponse.encode(message.truck, writer.uint32(10).fork()).join();
|
|
450
|
+
}
|
|
451
|
+
if (message.updateMask !== undefined) {
|
|
452
|
+
FieldMask.encode(FieldMask.wrap(message.updateMask), writer.uint32(18).fork()).join();
|
|
453
|
+
}
|
|
454
|
+
return writer;
|
|
455
|
+
},
|
|
456
|
+
|
|
457
|
+
decode(input: BinaryReader | Uint8Array, length?: number): UpdateTruckRequest {
|
|
458
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
459
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
460
|
+
const message = createBaseUpdateTruckRequest();
|
|
461
|
+
while (reader.pos < end) {
|
|
462
|
+
const tag = reader.uint32();
|
|
463
|
+
switch (tag >>> 3) {
|
|
464
|
+
case 1: {
|
|
465
|
+
if (tag !== 10) {
|
|
466
|
+
break;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
message.truck = TruckResponse.decode(reader, reader.uint32());
|
|
470
|
+
continue;
|
|
471
|
+
}
|
|
472
|
+
case 2: {
|
|
473
|
+
if (tag !== 18) {
|
|
474
|
+
break;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
message.updateMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32()));
|
|
478
|
+
continue;
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
482
|
+
break;
|
|
483
|
+
}
|
|
484
|
+
reader.skip(tag & 7);
|
|
485
|
+
}
|
|
486
|
+
return message;
|
|
487
|
+
},
|
|
488
|
+
|
|
489
|
+
create<I extends Exact<DeepPartial<UpdateTruckRequest>, I>>(base?: I): UpdateTruckRequest {
|
|
490
|
+
return UpdateTruckRequest.fromPartial(base ?? ({} as any));
|
|
491
|
+
},
|
|
492
|
+
fromPartial<I extends Exact<DeepPartial<UpdateTruckRequest>, I>>(object: I): UpdateTruckRequest {
|
|
493
|
+
const message = createBaseUpdateTruckRequest();
|
|
494
|
+
message.truck = (object.truck !== undefined && object.truck !== null)
|
|
495
|
+
? TruckResponse.fromPartial(object.truck)
|
|
496
|
+
: undefined;
|
|
497
|
+
message.updateMask = object.updateMask ?? undefined;
|
|
498
|
+
return message;
|
|
499
|
+
},
|
|
500
|
+
};
|
|
501
|
+
|
|
502
|
+
function createBaseTruckResponse(): TruckResponse {
|
|
503
|
+
return {
|
|
504
|
+
id: "",
|
|
505
|
+
make: "",
|
|
506
|
+
model: "",
|
|
507
|
+
year: undefined,
|
|
508
|
+
vin: "",
|
|
509
|
+
plate: undefined,
|
|
510
|
+
plateState: undefined,
|
|
511
|
+
length: 0,
|
|
512
|
+
width: 0,
|
|
513
|
+
height: 0,
|
|
514
|
+
doorWidth: 0,
|
|
515
|
+
doorHeight: 0,
|
|
516
|
+
capacity: 0,
|
|
517
|
+
dockHigh: 0,
|
|
518
|
+
type: 0,
|
|
519
|
+
equipment: [],
|
|
520
|
+
company: "",
|
|
521
|
+
};
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
export const TruckResponse: MessageFns<TruckResponse> = {
|
|
525
|
+
encode(message: TruckResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
526
|
+
if (message.id !== "") {
|
|
527
|
+
writer.uint32(10).string(message.id);
|
|
528
|
+
}
|
|
529
|
+
if (message.make !== "") {
|
|
530
|
+
writer.uint32(18).string(message.make);
|
|
531
|
+
}
|
|
532
|
+
if (message.model !== "") {
|
|
533
|
+
writer.uint32(26).string(message.model);
|
|
534
|
+
}
|
|
535
|
+
if (message.year !== undefined) {
|
|
536
|
+
Int32Value.encode({ value: message.year! }, writer.uint32(34).fork()).join();
|
|
537
|
+
}
|
|
538
|
+
if (message.vin !== "") {
|
|
539
|
+
writer.uint32(42).string(message.vin);
|
|
540
|
+
}
|
|
541
|
+
if (message.plate !== undefined) {
|
|
542
|
+
StringValue.encode({ value: message.plate! }, writer.uint32(50).fork()).join();
|
|
543
|
+
}
|
|
544
|
+
if (message.plateState !== undefined) {
|
|
545
|
+
StringValue.encode({ value: message.plateState! }, writer.uint32(58).fork()).join();
|
|
546
|
+
}
|
|
547
|
+
if (message.length !== 0) {
|
|
548
|
+
writer.uint32(64).int32(message.length);
|
|
549
|
+
}
|
|
550
|
+
if (message.width !== 0) {
|
|
551
|
+
writer.uint32(72).int32(message.width);
|
|
552
|
+
}
|
|
553
|
+
if (message.height !== 0) {
|
|
554
|
+
writer.uint32(80).int32(message.height);
|
|
555
|
+
}
|
|
556
|
+
if (message.doorWidth !== 0) {
|
|
557
|
+
writer.uint32(88).int32(message.doorWidth);
|
|
558
|
+
}
|
|
559
|
+
if (message.doorHeight !== 0) {
|
|
560
|
+
writer.uint32(96).int32(message.doorHeight);
|
|
561
|
+
}
|
|
562
|
+
if (message.capacity !== 0) {
|
|
563
|
+
writer.uint32(104).int32(message.capacity);
|
|
564
|
+
}
|
|
565
|
+
if (message.dockHigh !== 0) {
|
|
566
|
+
writer.uint32(112).int32(message.dockHigh);
|
|
567
|
+
}
|
|
568
|
+
if (message.type !== 0) {
|
|
569
|
+
writer.uint32(120).int32(message.type);
|
|
570
|
+
}
|
|
571
|
+
writer.uint32(130).fork();
|
|
572
|
+
for (const v of message.equipment) {
|
|
573
|
+
writer.int32(v);
|
|
574
|
+
}
|
|
575
|
+
writer.join();
|
|
576
|
+
if (message.company !== "") {
|
|
577
|
+
writer.uint32(138).string(message.company);
|
|
578
|
+
}
|
|
579
|
+
return writer;
|
|
580
|
+
},
|
|
581
|
+
|
|
582
|
+
decode(input: BinaryReader | Uint8Array, length?: number): TruckResponse {
|
|
583
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
584
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
585
|
+
const message = createBaseTruckResponse();
|
|
586
|
+
while (reader.pos < end) {
|
|
587
|
+
const tag = reader.uint32();
|
|
588
|
+
switch (tag >>> 3) {
|
|
589
|
+
case 1: {
|
|
590
|
+
if (tag !== 10) {
|
|
591
|
+
break;
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
message.id = reader.string();
|
|
595
|
+
continue;
|
|
596
|
+
}
|
|
597
|
+
case 2: {
|
|
598
|
+
if (tag !== 18) {
|
|
599
|
+
break;
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
message.make = reader.string();
|
|
603
|
+
continue;
|
|
604
|
+
}
|
|
605
|
+
case 3: {
|
|
606
|
+
if (tag !== 26) {
|
|
607
|
+
break;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
message.model = reader.string();
|
|
611
|
+
continue;
|
|
612
|
+
}
|
|
613
|
+
case 4: {
|
|
614
|
+
if (tag !== 34) {
|
|
615
|
+
break;
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
message.year = Int32Value.decode(reader, reader.uint32()).value;
|
|
619
|
+
continue;
|
|
620
|
+
}
|
|
621
|
+
case 5: {
|
|
622
|
+
if (tag !== 42) {
|
|
623
|
+
break;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
message.vin = reader.string();
|
|
627
|
+
continue;
|
|
628
|
+
}
|
|
629
|
+
case 6: {
|
|
630
|
+
if (tag !== 50) {
|
|
631
|
+
break;
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
message.plate = StringValue.decode(reader, reader.uint32()).value;
|
|
635
|
+
continue;
|
|
636
|
+
}
|
|
637
|
+
case 7: {
|
|
638
|
+
if (tag !== 58) {
|
|
639
|
+
break;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
message.plateState = StringValue.decode(reader, reader.uint32()).value;
|
|
643
|
+
continue;
|
|
644
|
+
}
|
|
645
|
+
case 8: {
|
|
646
|
+
if (tag !== 64) {
|
|
647
|
+
break;
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
message.length = reader.int32();
|
|
651
|
+
continue;
|
|
652
|
+
}
|
|
653
|
+
case 9: {
|
|
654
|
+
if (tag !== 72) {
|
|
655
|
+
break;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
message.width = reader.int32();
|
|
659
|
+
continue;
|
|
660
|
+
}
|
|
661
|
+
case 10: {
|
|
662
|
+
if (tag !== 80) {
|
|
663
|
+
break;
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
message.height = reader.int32();
|
|
667
|
+
continue;
|
|
668
|
+
}
|
|
669
|
+
case 11: {
|
|
670
|
+
if (tag !== 88) {
|
|
671
|
+
break;
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
message.doorWidth = reader.int32();
|
|
675
|
+
continue;
|
|
676
|
+
}
|
|
677
|
+
case 12: {
|
|
678
|
+
if (tag !== 96) {
|
|
679
|
+
break;
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
message.doorHeight = reader.int32();
|
|
683
|
+
continue;
|
|
684
|
+
}
|
|
685
|
+
case 13: {
|
|
686
|
+
if (tag !== 104) {
|
|
687
|
+
break;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
message.capacity = reader.int32();
|
|
691
|
+
continue;
|
|
692
|
+
}
|
|
693
|
+
case 14: {
|
|
694
|
+
if (tag !== 112) {
|
|
695
|
+
break;
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
message.dockHigh = reader.int32() as any;
|
|
699
|
+
continue;
|
|
700
|
+
}
|
|
701
|
+
case 15: {
|
|
702
|
+
if (tag !== 120) {
|
|
703
|
+
break;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
message.type = reader.int32() as any;
|
|
707
|
+
continue;
|
|
708
|
+
}
|
|
709
|
+
case 16: {
|
|
710
|
+
if (tag === 128) {
|
|
711
|
+
message.equipment.push(reader.int32() as any);
|
|
712
|
+
|
|
713
|
+
continue;
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
if (tag === 130) {
|
|
717
|
+
const end2 = reader.uint32() + reader.pos;
|
|
718
|
+
while (reader.pos < end2) {
|
|
719
|
+
message.equipment.push(reader.int32() as any);
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
continue;
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
break;
|
|
726
|
+
}
|
|
727
|
+
case 17: {
|
|
728
|
+
if (tag !== 138) {
|
|
729
|
+
break;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
message.company = reader.string();
|
|
733
|
+
continue;
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
737
|
+
break;
|
|
738
|
+
}
|
|
739
|
+
reader.skip(tag & 7);
|
|
740
|
+
}
|
|
741
|
+
return message;
|
|
742
|
+
},
|
|
743
|
+
|
|
744
|
+
create<I extends Exact<DeepPartial<TruckResponse>, I>>(base?: I): TruckResponse {
|
|
745
|
+
return TruckResponse.fromPartial(base ?? ({} as any));
|
|
746
|
+
},
|
|
747
|
+
fromPartial<I extends Exact<DeepPartial<TruckResponse>, I>>(object: I): TruckResponse {
|
|
748
|
+
const message = createBaseTruckResponse();
|
|
749
|
+
message.id = object.id ?? "";
|
|
750
|
+
message.make = object.make ?? "";
|
|
751
|
+
message.model = object.model ?? "";
|
|
752
|
+
message.year = object.year ?? undefined;
|
|
753
|
+
message.vin = object.vin ?? "";
|
|
754
|
+
message.plate = object.plate ?? undefined;
|
|
755
|
+
message.plateState = object.plateState ?? undefined;
|
|
756
|
+
message.length = object.length ?? 0;
|
|
757
|
+
message.width = object.width ?? 0;
|
|
758
|
+
message.height = object.height ?? 0;
|
|
759
|
+
message.doorWidth = object.doorWidth ?? 0;
|
|
760
|
+
message.doorHeight = object.doorHeight ?? 0;
|
|
761
|
+
message.capacity = object.capacity ?? 0;
|
|
762
|
+
message.dockHigh = object.dockHigh ?? 0;
|
|
763
|
+
message.type = object.type ?? 0;
|
|
764
|
+
message.equipment = object.equipment?.map((e) => e) || [];
|
|
765
|
+
message.company = object.company ?? "";
|
|
766
|
+
return message;
|
|
767
|
+
},
|
|
768
|
+
};
|
|
769
|
+
|
|
770
|
+
function createBaseGetOneTruckRequest(): GetOneTruckRequest {
|
|
771
|
+
return { id: "" };
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
export const GetOneTruckRequest: MessageFns<GetOneTruckRequest> = {
|
|
775
|
+
encode(message: GetOneTruckRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
776
|
+
if (message.id !== "") {
|
|
777
|
+
writer.uint32(10).string(message.id);
|
|
778
|
+
}
|
|
779
|
+
return writer;
|
|
780
|
+
},
|
|
781
|
+
|
|
782
|
+
decode(input: BinaryReader | Uint8Array, length?: number): GetOneTruckRequest {
|
|
783
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
784
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
785
|
+
const message = createBaseGetOneTruckRequest();
|
|
786
|
+
while (reader.pos < end) {
|
|
787
|
+
const tag = reader.uint32();
|
|
788
|
+
switch (tag >>> 3) {
|
|
789
|
+
case 1: {
|
|
790
|
+
if (tag !== 10) {
|
|
791
|
+
break;
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
message.id = reader.string();
|
|
795
|
+
continue;
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
799
|
+
break;
|
|
800
|
+
}
|
|
801
|
+
reader.skip(tag & 7);
|
|
802
|
+
}
|
|
803
|
+
return message;
|
|
804
|
+
},
|
|
805
|
+
|
|
806
|
+
create<I extends Exact<DeepPartial<GetOneTruckRequest>, I>>(base?: I): GetOneTruckRequest {
|
|
807
|
+
return GetOneTruckRequest.fromPartial(base ?? ({} as any));
|
|
808
|
+
},
|
|
809
|
+
fromPartial<I extends Exact<DeepPartial<GetOneTruckRequest>, I>>(object: I): GetOneTruckRequest {
|
|
810
|
+
const message = createBaseGetOneTruckRequest();
|
|
811
|
+
message.id = object.id ?? "";
|
|
812
|
+
return message;
|
|
813
|
+
},
|
|
814
|
+
};
|
|
815
|
+
|
|
816
|
+
function createBaseTruckPaginatedResponse(): TruckPaginatedResponse {
|
|
817
|
+
return { data: [], meta: undefined };
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
export const TruckPaginatedResponse: MessageFns<TruckPaginatedResponse> = {
|
|
821
|
+
encode(message: TruckPaginatedResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
822
|
+
for (const v of message.data) {
|
|
823
|
+
TruckResponse.encode(v!, writer.uint32(10).fork()).join();
|
|
824
|
+
}
|
|
825
|
+
if (message.meta !== undefined) {
|
|
826
|
+
PaginateMeta.encode(message.meta, writer.uint32(18).fork()).join();
|
|
827
|
+
}
|
|
828
|
+
return writer;
|
|
829
|
+
},
|
|
830
|
+
|
|
831
|
+
decode(input: BinaryReader | Uint8Array, length?: number): TruckPaginatedResponse {
|
|
832
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
833
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
834
|
+
const message = createBaseTruckPaginatedResponse();
|
|
835
|
+
while (reader.pos < end) {
|
|
836
|
+
const tag = reader.uint32();
|
|
837
|
+
switch (tag >>> 3) {
|
|
838
|
+
case 1: {
|
|
839
|
+
if (tag !== 10) {
|
|
840
|
+
break;
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
message.data.push(TruckResponse.decode(reader, reader.uint32()));
|
|
844
|
+
continue;
|
|
845
|
+
}
|
|
846
|
+
case 2: {
|
|
847
|
+
if (tag !== 18) {
|
|
848
|
+
break;
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
message.meta = PaginateMeta.decode(reader, reader.uint32());
|
|
852
|
+
continue;
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
856
|
+
break;
|
|
857
|
+
}
|
|
858
|
+
reader.skip(tag & 7);
|
|
859
|
+
}
|
|
860
|
+
return message;
|
|
861
|
+
},
|
|
862
|
+
|
|
863
|
+
create<I extends Exact<DeepPartial<TruckPaginatedResponse>, I>>(base?: I): TruckPaginatedResponse {
|
|
864
|
+
return TruckPaginatedResponse.fromPartial(base ?? ({} as any));
|
|
865
|
+
},
|
|
866
|
+
fromPartial<I extends Exact<DeepPartial<TruckPaginatedResponse>, I>>(object: I): TruckPaginatedResponse {
|
|
867
|
+
const message = createBaseTruckPaginatedResponse();
|
|
868
|
+
message.data = object.data?.map((e) => TruckResponse.fromPartial(e)) || [];
|
|
869
|
+
message.meta = (object.meta !== undefined && object.meta !== null)
|
|
870
|
+
? PaginateMeta.fromPartial(object.meta)
|
|
871
|
+
: undefined;
|
|
872
|
+
return message;
|
|
873
|
+
},
|
|
874
|
+
};
|
|
875
|
+
|
|
876
|
+
function createBaseTruckNotPaginatedResponse(): TruckNotPaginatedResponse {
|
|
877
|
+
return { data: [] };
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
export const TruckNotPaginatedResponse: MessageFns<TruckNotPaginatedResponse> = {
|
|
881
|
+
encode(message: TruckNotPaginatedResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
882
|
+
for (const v of message.data) {
|
|
883
|
+
TruckResponse.encode(v!, writer.uint32(10).fork()).join();
|
|
884
|
+
}
|
|
885
|
+
return writer;
|
|
886
|
+
},
|
|
887
|
+
|
|
888
|
+
decode(input: BinaryReader | Uint8Array, length?: number): TruckNotPaginatedResponse {
|
|
889
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
890
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
891
|
+
const message = createBaseTruckNotPaginatedResponse();
|
|
892
|
+
while (reader.pos < end) {
|
|
893
|
+
const tag = reader.uint32();
|
|
894
|
+
switch (tag >>> 3) {
|
|
895
|
+
case 1: {
|
|
896
|
+
if (tag !== 10) {
|
|
897
|
+
break;
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
message.data.push(TruckResponse.decode(reader, reader.uint32()));
|
|
901
|
+
continue;
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
905
|
+
break;
|
|
906
|
+
}
|
|
907
|
+
reader.skip(tag & 7);
|
|
908
|
+
}
|
|
909
|
+
return message;
|
|
910
|
+
},
|
|
911
|
+
|
|
912
|
+
create<I extends Exact<DeepPartial<TruckNotPaginatedResponse>, I>>(base?: I): TruckNotPaginatedResponse {
|
|
913
|
+
return TruckNotPaginatedResponse.fromPartial(base ?? ({} as any));
|
|
914
|
+
},
|
|
915
|
+
fromPartial<I extends Exact<DeepPartial<TruckNotPaginatedResponse>, I>>(object: I): TruckNotPaginatedResponse {
|
|
916
|
+
const message = createBaseTruckNotPaginatedResponse();
|
|
917
|
+
message.data = object.data?.map((e) => TruckResponse.fromPartial(e)) || [];
|
|
918
|
+
return message;
|
|
919
|
+
},
|
|
920
|
+
};
|
|
921
|
+
|
|
922
|
+
function createBaseDeleteTruckRequest(): DeleteTruckRequest {
|
|
923
|
+
return { id: "" };
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
export const DeleteTruckRequest: MessageFns<DeleteTruckRequest> = {
|
|
927
|
+
encode(message: DeleteTruckRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
928
|
+
if (message.id !== "") {
|
|
929
|
+
writer.uint32(10).string(message.id);
|
|
930
|
+
}
|
|
931
|
+
return writer;
|
|
932
|
+
},
|
|
933
|
+
|
|
934
|
+
decode(input: BinaryReader | Uint8Array, length?: number): DeleteTruckRequest {
|
|
935
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
936
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
937
|
+
const message = createBaseDeleteTruckRequest();
|
|
938
|
+
while (reader.pos < end) {
|
|
939
|
+
const tag = reader.uint32();
|
|
940
|
+
switch (tag >>> 3) {
|
|
941
|
+
case 1: {
|
|
942
|
+
if (tag !== 10) {
|
|
943
|
+
break;
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
message.id = reader.string();
|
|
947
|
+
continue;
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
951
|
+
break;
|
|
952
|
+
}
|
|
953
|
+
reader.skip(tag & 7);
|
|
954
|
+
}
|
|
955
|
+
return message;
|
|
956
|
+
},
|
|
957
|
+
|
|
958
|
+
create<I extends Exact<DeepPartial<DeleteTruckRequest>, I>>(base?: I): DeleteTruckRequest {
|
|
959
|
+
return DeleteTruckRequest.fromPartial(base ?? ({} as any));
|
|
960
|
+
},
|
|
961
|
+
fromPartial<I extends Exact<DeepPartial<DeleteTruckRequest>, I>>(object: I): DeleteTruckRequest {
|
|
962
|
+
const message = createBaseDeleteTruckRequest();
|
|
963
|
+
message.id = object.id ?? "";
|
|
964
|
+
return message;
|
|
965
|
+
},
|
|
966
|
+
};
|
|
967
|
+
|
|
968
|
+
function createBaseDeleteTruckResponse(): DeleteTruckResponse {
|
|
969
|
+
return { success: false };
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
export const DeleteTruckResponse: MessageFns<DeleteTruckResponse> = {
|
|
973
|
+
encode(message: DeleteTruckResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
974
|
+
if (message.success !== false) {
|
|
975
|
+
writer.uint32(8).bool(message.success);
|
|
976
|
+
}
|
|
977
|
+
return writer;
|
|
978
|
+
},
|
|
979
|
+
|
|
980
|
+
decode(input: BinaryReader | Uint8Array, length?: number): DeleteTruckResponse {
|
|
981
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
982
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
983
|
+
const message = createBaseDeleteTruckResponse();
|
|
984
|
+
while (reader.pos < end) {
|
|
985
|
+
const tag = reader.uint32();
|
|
986
|
+
switch (tag >>> 3) {
|
|
987
|
+
case 1: {
|
|
988
|
+
if (tag !== 8) {
|
|
989
|
+
break;
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
message.success = reader.bool();
|
|
993
|
+
continue;
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
997
|
+
break;
|
|
998
|
+
}
|
|
999
|
+
reader.skip(tag & 7);
|
|
1000
|
+
}
|
|
1001
|
+
return message;
|
|
1002
|
+
},
|
|
1003
|
+
|
|
1004
|
+
create<I extends Exact<DeepPartial<DeleteTruckResponse>, I>>(base?: I): DeleteTruckResponse {
|
|
1005
|
+
return DeleteTruckResponse.fromPartial(base ?? ({} as any));
|
|
1006
|
+
},
|
|
1007
|
+
fromPartial<I extends Exact<DeepPartial<DeleteTruckResponse>, I>>(object: I): DeleteTruckResponse {
|
|
1008
|
+
const message = createBaseDeleteTruckResponse();
|
|
1009
|
+
message.success = object.success ?? false;
|
|
1010
|
+
return message;
|
|
1011
|
+
},
|
|
1012
|
+
};
|
|
1013
|
+
|
|
1014
|
+
/** --- Service --- */
|
|
1015
|
+
export interface TrucksService {
|
|
1016
|
+
/** Creating one truck */
|
|
1017
|
+
Create(request: CreateTruckRequest): Promise<TruckResponse>;
|
|
1018
|
+
/** Updating one truck by "id" */
|
|
1019
|
+
Update(request: UpdateTruckRequest): Promise<TruckResponse>;
|
|
1020
|
+
/** Getting one truck by "id" */
|
|
1021
|
+
GetOne(request: GetOneTruckRequest): Promise<TruckResponse>;
|
|
1022
|
+
/** Getting paginated response */
|
|
1023
|
+
GetAllPaginated(request: PaginateQuery): Promise<TruckPaginatedResponse>;
|
|
1024
|
+
/** Getting not paginated response */
|
|
1025
|
+
GetAllNotPaginated(request: FilterQuery): Promise<TruckNotPaginatedResponse>;
|
|
1026
|
+
/** Delete one truck by "id" */
|
|
1027
|
+
Delete(request: DeleteTruckRequest): Promise<DeleteTruckResponse>;
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
export const TrucksServiceServiceName = "truck.v1.TrucksService";
|
|
1031
|
+
export class TrucksServiceClientImpl implements TrucksService {
|
|
1032
|
+
private readonly rpc: Rpc;
|
|
1033
|
+
private readonly service: string;
|
|
1034
|
+
constructor(rpc: Rpc, opts?: { service?: string }) {
|
|
1035
|
+
this.service = opts?.service || TrucksServiceServiceName;
|
|
1036
|
+
this.rpc = rpc;
|
|
1037
|
+
this.Create = this.Create.bind(this);
|
|
1038
|
+
this.Update = this.Update.bind(this);
|
|
1039
|
+
this.GetOne = this.GetOne.bind(this);
|
|
1040
|
+
this.GetAllPaginated = this.GetAllPaginated.bind(this);
|
|
1041
|
+
this.GetAllNotPaginated = this.GetAllNotPaginated.bind(this);
|
|
1042
|
+
this.Delete = this.Delete.bind(this);
|
|
1043
|
+
}
|
|
1044
|
+
Create(request: CreateTruckRequest): Promise<TruckResponse> {
|
|
1045
|
+
const data = CreateTruckRequest.encode(request).finish();
|
|
1046
|
+
const promise = this.rpc.request(this.service, "Create", data);
|
|
1047
|
+
return promise.then((data) => TruckResponse.decode(new BinaryReader(data)));
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
Update(request: UpdateTruckRequest): Promise<TruckResponse> {
|
|
1051
|
+
const data = UpdateTruckRequest.encode(request).finish();
|
|
1052
|
+
const promise = this.rpc.request(this.service, "Update", data);
|
|
1053
|
+
return promise.then((data) => TruckResponse.decode(new BinaryReader(data)));
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
GetOne(request: GetOneTruckRequest): Promise<TruckResponse> {
|
|
1057
|
+
const data = GetOneTruckRequest.encode(request).finish();
|
|
1058
|
+
const promise = this.rpc.request(this.service, "GetOne", data);
|
|
1059
|
+
return promise.then((data) => TruckResponse.decode(new BinaryReader(data)));
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
GetAllPaginated(request: PaginateQuery): Promise<TruckPaginatedResponse> {
|
|
1063
|
+
const data = PaginateQuery.encode(request).finish();
|
|
1064
|
+
const promise = this.rpc.request(this.service, "GetAllPaginated", data);
|
|
1065
|
+
return promise.then((data) => TruckPaginatedResponse.decode(new BinaryReader(data)));
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
GetAllNotPaginated(request: FilterQuery): Promise<TruckNotPaginatedResponse> {
|
|
1069
|
+
const data = FilterQuery.encode(request).finish();
|
|
1070
|
+
const promise = this.rpc.request(this.service, "GetAllNotPaginated", data);
|
|
1071
|
+
return promise.then((data) => TruckNotPaginatedResponse.decode(new BinaryReader(data)));
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
Delete(request: DeleteTruckRequest): Promise<DeleteTruckResponse> {
|
|
1075
|
+
const data = DeleteTruckRequest.encode(request).finish();
|
|
1076
|
+
const promise = this.rpc.request(this.service, "Delete", data);
|
|
1077
|
+
return promise.then((data) => DeleteTruckResponse.decode(new BinaryReader(data)));
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
interface Rpc {
|
|
1082
|
+
request(service: string, method: string, data: Uint8Array): Promise<Uint8Array>;
|
|
1083
|
+
}
|
|
1084
|
+
|
|
1085
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
1086
|
+
|
|
1087
|
+
export type DeepPartial<T> = T extends Builtin ? T
|
|
1088
|
+
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
|
1089
|
+
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
|
1090
|
+
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
1091
|
+
: Partial<T>;
|
|
1092
|
+
|
|
1093
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
1094
|
+
export type Exact<P, I extends P> = P extends Builtin ? P
|
|
1095
|
+
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
|
1096
|
+
|
|
1097
|
+
export interface MessageFns<T> {
|
|
1098
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
1099
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
1100
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
1101
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
1102
|
+
}
|