@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,368 @@
|
|
|
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: common-geocode-v1.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
9
|
+
|
|
10
|
+
export const protobufPackage = "common_geocode.v1";
|
|
11
|
+
|
|
12
|
+
export interface Point {
|
|
13
|
+
values: number[];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface Coordinates {
|
|
17
|
+
longitude: number;
|
|
18
|
+
latitude: number;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface Geometry {
|
|
22
|
+
type: string;
|
|
23
|
+
coordinates: number[];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface LineString {
|
|
27
|
+
type: string;
|
|
28
|
+
coordinates: Point[];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface ContextItem {
|
|
32
|
+
id: string;
|
|
33
|
+
text: string;
|
|
34
|
+
shortCode?: string | undefined;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function createBasePoint(): Point {
|
|
38
|
+
return { values: [] };
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export const Point: MessageFns<Point> = {
|
|
42
|
+
encode(message: Point, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
43
|
+
writer.uint32(10).fork();
|
|
44
|
+
for (const v of message.values) {
|
|
45
|
+
writer.double(v);
|
|
46
|
+
}
|
|
47
|
+
writer.join();
|
|
48
|
+
return writer;
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
decode(input: BinaryReader | Uint8Array, length?: number): Point {
|
|
52
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
53
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
54
|
+
const message = createBasePoint();
|
|
55
|
+
while (reader.pos < end) {
|
|
56
|
+
const tag = reader.uint32();
|
|
57
|
+
switch (tag >>> 3) {
|
|
58
|
+
case 1: {
|
|
59
|
+
if (tag === 9) {
|
|
60
|
+
message.values.push(reader.double());
|
|
61
|
+
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (tag === 10) {
|
|
66
|
+
const end2 = reader.uint32() + reader.pos;
|
|
67
|
+
while (reader.pos < end2) {
|
|
68
|
+
message.values.push(reader.double());
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
78
|
+
break;
|
|
79
|
+
}
|
|
80
|
+
reader.skip(tag & 7);
|
|
81
|
+
}
|
|
82
|
+
return message;
|
|
83
|
+
},
|
|
84
|
+
|
|
85
|
+
create<I extends Exact<DeepPartial<Point>, I>>(base?: I): Point {
|
|
86
|
+
return Point.fromPartial(base ?? ({} as any));
|
|
87
|
+
},
|
|
88
|
+
fromPartial<I extends Exact<DeepPartial<Point>, I>>(object: I): Point {
|
|
89
|
+
const message = createBasePoint();
|
|
90
|
+
message.values = object.values?.map((e) => e) || [];
|
|
91
|
+
return message;
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
function createBaseCoordinates(): Coordinates {
|
|
96
|
+
return { longitude: 0, latitude: 0 };
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export const Coordinates: MessageFns<Coordinates> = {
|
|
100
|
+
encode(message: Coordinates, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
101
|
+
if (message.longitude !== 0) {
|
|
102
|
+
writer.uint32(9).double(message.longitude);
|
|
103
|
+
}
|
|
104
|
+
if (message.latitude !== 0) {
|
|
105
|
+
writer.uint32(17).double(message.latitude);
|
|
106
|
+
}
|
|
107
|
+
return writer;
|
|
108
|
+
},
|
|
109
|
+
|
|
110
|
+
decode(input: BinaryReader | Uint8Array, length?: number): Coordinates {
|
|
111
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
112
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
113
|
+
const message = createBaseCoordinates();
|
|
114
|
+
while (reader.pos < end) {
|
|
115
|
+
const tag = reader.uint32();
|
|
116
|
+
switch (tag >>> 3) {
|
|
117
|
+
case 1: {
|
|
118
|
+
if (tag !== 9) {
|
|
119
|
+
break;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
message.longitude = reader.double();
|
|
123
|
+
continue;
|
|
124
|
+
}
|
|
125
|
+
case 2: {
|
|
126
|
+
if (tag !== 17) {
|
|
127
|
+
break;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
message.latitude = reader.double();
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
reader.skip(tag & 7);
|
|
138
|
+
}
|
|
139
|
+
return message;
|
|
140
|
+
},
|
|
141
|
+
|
|
142
|
+
create<I extends Exact<DeepPartial<Coordinates>, I>>(base?: I): Coordinates {
|
|
143
|
+
return Coordinates.fromPartial(base ?? ({} as any));
|
|
144
|
+
},
|
|
145
|
+
fromPartial<I extends Exact<DeepPartial<Coordinates>, I>>(object: I): Coordinates {
|
|
146
|
+
const message = createBaseCoordinates();
|
|
147
|
+
message.longitude = object.longitude ?? 0;
|
|
148
|
+
message.latitude = object.latitude ?? 0;
|
|
149
|
+
return message;
|
|
150
|
+
},
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
function createBaseGeometry(): Geometry {
|
|
154
|
+
return { type: "", coordinates: [] };
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export const Geometry: MessageFns<Geometry> = {
|
|
158
|
+
encode(message: Geometry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
159
|
+
if (message.type !== "") {
|
|
160
|
+
writer.uint32(10).string(message.type);
|
|
161
|
+
}
|
|
162
|
+
writer.uint32(18).fork();
|
|
163
|
+
for (const v of message.coordinates) {
|
|
164
|
+
writer.double(v);
|
|
165
|
+
}
|
|
166
|
+
writer.join();
|
|
167
|
+
return writer;
|
|
168
|
+
},
|
|
169
|
+
|
|
170
|
+
decode(input: BinaryReader | Uint8Array, length?: number): Geometry {
|
|
171
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
172
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
173
|
+
const message = createBaseGeometry();
|
|
174
|
+
while (reader.pos < end) {
|
|
175
|
+
const tag = reader.uint32();
|
|
176
|
+
switch (tag >>> 3) {
|
|
177
|
+
case 1: {
|
|
178
|
+
if (tag !== 10) {
|
|
179
|
+
break;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
message.type = reader.string();
|
|
183
|
+
continue;
|
|
184
|
+
}
|
|
185
|
+
case 2: {
|
|
186
|
+
if (tag === 17) {
|
|
187
|
+
message.coordinates.push(reader.double());
|
|
188
|
+
|
|
189
|
+
continue;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
if (tag === 18) {
|
|
193
|
+
const end2 = reader.uint32() + reader.pos;
|
|
194
|
+
while (reader.pos < end2) {
|
|
195
|
+
message.coordinates.push(reader.double());
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
continue;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
break;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
205
|
+
break;
|
|
206
|
+
}
|
|
207
|
+
reader.skip(tag & 7);
|
|
208
|
+
}
|
|
209
|
+
return message;
|
|
210
|
+
},
|
|
211
|
+
|
|
212
|
+
create<I extends Exact<DeepPartial<Geometry>, I>>(base?: I): Geometry {
|
|
213
|
+
return Geometry.fromPartial(base ?? ({} as any));
|
|
214
|
+
},
|
|
215
|
+
fromPartial<I extends Exact<DeepPartial<Geometry>, I>>(object: I): Geometry {
|
|
216
|
+
const message = createBaseGeometry();
|
|
217
|
+
message.type = object.type ?? "";
|
|
218
|
+
message.coordinates = object.coordinates?.map((e) => e) || [];
|
|
219
|
+
return message;
|
|
220
|
+
},
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
function createBaseLineString(): LineString {
|
|
224
|
+
return { type: "", coordinates: [] };
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export const LineString: MessageFns<LineString> = {
|
|
228
|
+
encode(message: LineString, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
229
|
+
if (message.type !== "") {
|
|
230
|
+
writer.uint32(10).string(message.type);
|
|
231
|
+
}
|
|
232
|
+
for (const v of message.coordinates) {
|
|
233
|
+
Point.encode(v!, writer.uint32(18).fork()).join();
|
|
234
|
+
}
|
|
235
|
+
return writer;
|
|
236
|
+
},
|
|
237
|
+
|
|
238
|
+
decode(input: BinaryReader | Uint8Array, length?: number): LineString {
|
|
239
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
240
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
241
|
+
const message = createBaseLineString();
|
|
242
|
+
while (reader.pos < end) {
|
|
243
|
+
const tag = reader.uint32();
|
|
244
|
+
switch (tag >>> 3) {
|
|
245
|
+
case 1: {
|
|
246
|
+
if (tag !== 10) {
|
|
247
|
+
break;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
message.type = reader.string();
|
|
251
|
+
continue;
|
|
252
|
+
}
|
|
253
|
+
case 2: {
|
|
254
|
+
if (tag !== 18) {
|
|
255
|
+
break;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
message.coordinates.push(Point.decode(reader, reader.uint32()));
|
|
259
|
+
continue;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
263
|
+
break;
|
|
264
|
+
}
|
|
265
|
+
reader.skip(tag & 7);
|
|
266
|
+
}
|
|
267
|
+
return message;
|
|
268
|
+
},
|
|
269
|
+
|
|
270
|
+
create<I extends Exact<DeepPartial<LineString>, I>>(base?: I): LineString {
|
|
271
|
+
return LineString.fromPartial(base ?? ({} as any));
|
|
272
|
+
},
|
|
273
|
+
fromPartial<I extends Exact<DeepPartial<LineString>, I>>(object: I): LineString {
|
|
274
|
+
const message = createBaseLineString();
|
|
275
|
+
message.type = object.type ?? "";
|
|
276
|
+
message.coordinates = object.coordinates?.map((e) => Point.fromPartial(e)) || [];
|
|
277
|
+
return message;
|
|
278
|
+
},
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
function createBaseContextItem(): ContextItem {
|
|
282
|
+
return { id: "", text: "", shortCode: undefined };
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
export const ContextItem: MessageFns<ContextItem> = {
|
|
286
|
+
encode(message: ContextItem, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
287
|
+
if (message.id !== "") {
|
|
288
|
+
writer.uint32(10).string(message.id);
|
|
289
|
+
}
|
|
290
|
+
if (message.text !== "") {
|
|
291
|
+
writer.uint32(18).string(message.text);
|
|
292
|
+
}
|
|
293
|
+
if (message.shortCode !== undefined) {
|
|
294
|
+
writer.uint32(26).string(message.shortCode);
|
|
295
|
+
}
|
|
296
|
+
return writer;
|
|
297
|
+
},
|
|
298
|
+
|
|
299
|
+
decode(input: BinaryReader | Uint8Array, length?: number): ContextItem {
|
|
300
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
301
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
302
|
+
const message = createBaseContextItem();
|
|
303
|
+
while (reader.pos < end) {
|
|
304
|
+
const tag = reader.uint32();
|
|
305
|
+
switch (tag >>> 3) {
|
|
306
|
+
case 1: {
|
|
307
|
+
if (tag !== 10) {
|
|
308
|
+
break;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
message.id = reader.string();
|
|
312
|
+
continue;
|
|
313
|
+
}
|
|
314
|
+
case 2: {
|
|
315
|
+
if (tag !== 18) {
|
|
316
|
+
break;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
message.text = reader.string();
|
|
320
|
+
continue;
|
|
321
|
+
}
|
|
322
|
+
case 3: {
|
|
323
|
+
if (tag !== 26) {
|
|
324
|
+
break;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
message.shortCode = reader.string();
|
|
328
|
+
continue;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
332
|
+
break;
|
|
333
|
+
}
|
|
334
|
+
reader.skip(tag & 7);
|
|
335
|
+
}
|
|
336
|
+
return message;
|
|
337
|
+
},
|
|
338
|
+
|
|
339
|
+
create<I extends Exact<DeepPartial<ContextItem>, I>>(base?: I): ContextItem {
|
|
340
|
+
return ContextItem.fromPartial(base ?? ({} as any));
|
|
341
|
+
},
|
|
342
|
+
fromPartial<I extends Exact<DeepPartial<ContextItem>, I>>(object: I): ContextItem {
|
|
343
|
+
const message = createBaseContextItem();
|
|
344
|
+
message.id = object.id ?? "";
|
|
345
|
+
message.text = object.text ?? "";
|
|
346
|
+
message.shortCode = object.shortCode ?? undefined;
|
|
347
|
+
return message;
|
|
348
|
+
},
|
|
349
|
+
};
|
|
350
|
+
|
|
351
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
352
|
+
|
|
353
|
+
export type DeepPartial<T> = T extends Builtin ? T
|
|
354
|
+
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
|
355
|
+
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
|
356
|
+
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
357
|
+
: Partial<T>;
|
|
358
|
+
|
|
359
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
360
|
+
export type Exact<P, I extends P> = P extends Builtin ? P
|
|
361
|
+
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
|
362
|
+
|
|
363
|
+
export interface MessageFns<T> {
|
|
364
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
365
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
366
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
367
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
368
|
+
}
|